Thursday, September 29, 2011

addClass(String)

addClass(String class) returns jQuery
Adds the specified class(es) to each of the set of matched elements.

Example:

$("p").addClass("selected")

HTML:
<p>Hello</p>

Result:
[ <p class="selected">Hello</p> ]

No comments:

Post a Comment