How to change css value with jquery

You can change css value with jquery an example of this is below, you can change any css value with jquery so chnage it according to your need.

CSS

.content{background:#ccc;}

Jquery

$(document).ready(function(){
  $('#change').click(function(){
   $('.content').css("background-color","#FF0000");
   $('.content').css("color","#FFF");
  });
 });

HTML

This is a sample content.
Click to change above div css
Download File Used in this example View Live Demo

No comments:

Post a Comment