Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jQuery CSS Classes

//addClass()
$("button").click(function(){
  $("#div1").addClass("important blue");
});

//removeClass()
$("button").click(function(){
  $("h1, h2, p").removeClass("blue");
});

//toggleClass()
$("button").click(function(){
  $("h1, h2, p").toggleClass("blue");
});

//css()
$("p").css("background-color", "yellow");
 
PREVIOUS NEXT
Tagged: #jQuery #CSS #Classes
ADD COMMENT
Topic
Name
4+3 =