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 ways
hasClass(className): determine whether a page element has a certain class
addClass(className | function): add the given CSS class to the elements in the matched set
removeClass(className | function): remove the given CSS class from the elements in the matched set
toggeClass(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
Creating new document content
jQuery makes the creation and manipulation of document content very easy. Rather than having to directly use the verbose DOM methods, you can roll several operations into just a few function calls.
html(str): can be used to retrieve or set the HTML content of an element
text(str): used to retrieve or set the text content of an element
This is paragraph 1
This is paragraph 2
This is paragraph 3
This is paragraph 4
This is paragraph 5
The jQuery Event object contains detailed information about each event that occurs in the page.
Click on each of the DIV elements below to see event-related information for each.