How we can modify the css class in jquery?



How we can modify the css class in jquery?..

Answer / Mandeep Kumar Srivastava

To modify a CSS class using jQuery, you can use .addClass() and .removeClass(). Here's an example:
```javascript
$(document).ready(function(){
$('.example').click(function(){
$(this).toggleClass('myClass');
});
});
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

What does dollar sign ($) means in jquery? : jquery mobile

1 Answers  


What is a cdn? : jQuery Mobile

1 Answers  


Can you please explain the difference between event.preventdefault and "return false"? : jquery mobile

1 Answers  


What is the use of .size() method in jquery?

1 Answers  


What are the types of selectors in jQuery?

1 Answers  


Differentiate between width() vs css(‘width’) in jquery

1 Answers  


What is a filter in jquery? Explain

1 Answers  


How to use jquery?

1 Answers  


Define url paremeter of jquery ajax method?

1 Answers  


What methods used to provide effects?

1 Answers  


Why there are two different version of jQuery library?

1 Answers  


Why do we use jquery? : jquery mobile

1 Answers  


Categories