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

Are You Starting A New Blog
Do You Want Best Web Hosting?

Try World's Best Web Hosting Provider BlueHost
At Just $3.95/mo

Hurry Up! Limited Time Offer

Yes, I Want To Check Out BlueHost

Check The World's Best SEO And All-In-One Marketing Toolkit
For Digital Marketing Professionals SEMRUSH

Check Out SEMRUSH