Getting and setting CSS information is accomplished via a set of dedicated jQuery functions.
In addition to setting and retrieving individual CSS properties, there are methods for easily changing the CSS classes assigned to page elements that work in a cross-browser manner.
css()
: get or set CSS properties on the matched elements in a variety of wayshasClass(className)
: determine whether a page element has a certain classaddClass(className | function)
: add the given CSS class to the elements in the matched setremoveClass(className | function)
: remove the given CSS class from the elements in the matched settoggeClass(className | function)
: add or remove the given CSS class to the elements in the matched set depending on whether it is already there
This is paragraph 1
This is paragraph 2
This is paragraph 3
This is paragraph 4
This is paragraph 5