jQuery HTML/CSS methods


jQuery HTML/CSS Methods


jQuery HTML/CSS Methods

The table below lists all the methods used to process HTML and CSS jQuery method.

The following methods apply to HTML and XML documents. Except: html() method.

##text( )Set or return the text content of the selected elementtoggleClass()Add/remove one or more elements from the selected element Switching between classes##wrap ()Wrap each selected element with HTML elementswrapAll()Wrap all selected elements with Wrap HTML elementswrapInner()Wrap HTML elements around the content of each selected element$.escapeSelector()Escape characters or strings with special meaning in CSS selectors$.cssHooks Provides a A way to get and set specific CSS values ​​by defining functions
MethodDescription
addClass()Add one or more elements to the selected element Class name
after()Insert content after the selected element
append()Insert content at the end of the selected element
appendTo()Insert HTML element at the end of the selected element
attr()Set or return the attribute/value of the selected element
before()Insert content before the selected element
clone()Generate a copy of the selected element
css() is the selected element Sets or returns one or more style properties
detach()Removes the selected element (preserving data and events)
empty()Remove all child nodes and content from the selected element
hasClass()Check whether the selected element contains Specified class name
height()Set or return the height of the selected element
html()Set or return the content of the selected element
innerHeight()Return the height of the element (including padding, excluding border)
innerWidth()Returns the width of the element (including padding, excluding border)
insertAfter()In Insert an HTML element after the selected element
insertBefore()Insert an HTML element before the selected element
offset( )Sets or returns the offset coordinates of the selected element (relative to the document)
offsetParent()Returns the first positioned ancestor Element
outerHeight()Returns the height of the element (including padding and border)
outerWidth() Returns the width of the element (including padding and border)
position() Returns the position of the element (relative to the parent element)
prepend()Insert content at the beginning of the selected element
prependTo()Insert content at the beginning of the selected element Insert HTML element
prop()Set or return the property/value of the selected element
remove()Remove selected elements (including data and events)
removeAttr()Remove one or more attributes from selected elements
removeClass()Remove one or more classes from the selected element
removeProp()Remove attributes set through the prop() method
replaceAll()Replace the selected elements with new HTML elements
replaceWith()Replace the selected element with new content
scrollLeft()Set or return the selected element Horizontal scroll bar position
scrollTop()Sets or returns the vertical scroll bar position of the selected element
unwrap()Remove the parent element of the selected element
val()Set or return the selected element Attribute value (for form elements)
width()Set or return the width of the selected element