Basic

Following are the properties of the basic:

Add Class: .$(selector).addClass(class)

This .addClass() method is used to add or insert a CSS class to a specified element.
It only adds class event to the selected elements and will not replace or remove the existing class.

Has Class: $(selector).hasClass(class)

This .hasClass() method is used to check the existence of a specified css class in the selected element.

Remove Class: $(selector).removeClass(classname)

This .removeClass() method is used to remove CSS class from the selected element. Multiple classes can be removed from an element, seperating the class names with space.



Ask Questions

Ask Question