jQuery HTML / CSSMethod
jQuery HTML / CSS Methods
The following table lists all jQuery methods for handling HTML and CSS.
The following methods apply to HTML and XML documents. Except: the html() method.
| Method | Description |
|---|---|
| addClass() | Add one or more class names to the selected elements |
| after() | Insert content after the selected elements |
| append() | Insert content at the end of the selected elements |
| appendTo() | Insert HTML elements at the end of the selected elements |
| attr() | Set or return attributes/values of the selected elements |
| before() | Insert content before the selected elements |
| clone() | Create a copy of the selected elements |
| css() | Set or return one or more style properties for the selected elements |
| detach() | Remove the selected elements (keeping data and events) |
| empty() | Remove all child nodes and content from the selected elements |
| hasClass() | Check whether the selected elements contain the specified class name |
| height() | Set or return the height of the selected elements |
| html() | Set or return the content of the selected elements |
| innerHeight() | Return the height of the element (including padding, excluding border) |
| innerWidth() | Return the width of the element (including padding, excluding border) |
| insertAfter() | Insert HTML elements after the selected elements |
| insertBefore() | Insert HTML elements before the selected elements |
| offset() | Set or return the offset coordinates of the selected elements (relative to the document) |
| offsetParent() | Return the first positioned ancestor element |
| outerHeight() | Return the height of the element (including padding and border) |
| outerWidth() | Return the width of the element (including padding and border) |
| position() | Return the position of the element (relative to the parent element) |
| prepend() | Insert content at the beginning of the selected elements |
| prependTo() | Insert HTML elements at the beginning of the selected elements |
| prop() | Set or return attributes/values of the selected elements |
| remove() | Remove the selected elements (including data and events) |
| removeAttr() | Remove one or more attributes from the selected elements |
| removeClass() | Remove one or more classes from the selected elements |
| removeProp() | Remove attributes set via the prop() method |
| replaceAll() | Replace the selected elements with new HTML elements |
| replaceWith() | Replace the selected elements with new content |
| scrollLeft() | Set or return the horizontal scrollbar position of the selected elements |
| scrollTop() | Set or return the vertical scrollbar position of the selected elements |
| text() | Set or return the text content of the selected elements |
| toggleClass() | Toggle between adding/removing one or more classes on the selected elements |
| unwrap() | Remove the parent element of the selected elements |
| val() | Set or return the value of the selected elements (for form elements) |
| width() | Set or return the width of the selected elements |
| wrap() | Wrap an HTML element around each selected element |
| wrapAll() | Wrap an HTML element around all selected elements |
| wrapInner() | Wrap an HTML element around the content of each selected element |
| $.escapeSelector() | Escape characters or strings with special meaning in CSS selectors |
| $.cssHooks | Provides a way to get and set specific CSS values by defining functions |
Other Extensions