1Basic Syntax:
2$(element).removeClass( "myClass yourClass" )
3-------------------------------------------------------------------------------------
4
5Html code example:
6<p class="red highlight">test1</p>
7<p class="red highlight marked">test2</p>
8<p class="red highlight">test3</p>
9<p class="red highlight">test4</p>
10
11// remove all highlight class from p tag
12<script>
13 $( "p" ).removeClass( "highlight" )
14</script>
15
16// output after execution of this code
17<p class="red">test1</p>
18<p class="red marked">test2</p>
19<p class="red">test3</p>
20<p class="red">test4</p>
21
1//Remove this same line after copying
2Basic Syntax:
3$(element).removeClass( "myClass yourClass" )
4-------------------------------------------------------------------------------------
5
6Html code example:
7<p class="red highlight">test1</p>
8<p class="red highlight marked">test2</p>
9<p class="red highlight">test3</p>
10<p class="red highlight">test4</p>
11
12// remove all highlight class from p tag
13<script>
14 $( "p" ).removeClass( "highlight" )
15</script>
16
17// output after execution of this code
18<p class="red">test1</p>
19<p class="red marked">test2</p>
20<p class="red">test3</p>
21<p class="red">test4</p>
1 $("div").removeClass("important");
2
3addClass() - Adds one or more classes to the selected elements
4removeClass() - Removes one or more classes from the selected elements
5toggleClass() - Toggles between adding/removing classes from the selected elements
6css() - Sets or returns the style attribute
1$("#id .class").css({ 'background-color' : '' });
2
3/*
4 As mentioned in the jquery documentation:
5 Setting the value of a style property to an empty string
6 removes that property from an element
7 if it has already been directly applied
8 e.g. $('#mydiv').css('color', '')
9*/