Join TalkersCode Now !

Get Latest Tutorials And Links On Web Development
And Get Existing Offers Via Email

jQuery CSS

jQuery CSS

jQuery CSS is used to get and set CSS styles to elements to set or get the style it uses css() property.


Syntax For Setting Single Property

css("property","value");


$("a").css("color","green");

Syntax For Setting Multiple Property

css({"property1":"value1","property2":"value2", "property3":"value3",...});


$("a").css({"color":"green","font-size":"20px"});

You can also add and remove element classes by these properties addClass(), removeClass().


jQuery addClass()

$("button").click(function(){
  $("a").addClass("active");
});

jQuery removeClass()

$("button").click(function(){
  $("a").removeClass("active");
});
PreviousNext

Join Us With Our 21000+ Subscribers And Get Our Latest Tutorials Update Via Email

Subscribe TalkersCode! One Of The Best
Web Development And Review Blog

Get Latest Tutorials And Reviews
Via Email