html
append
prepend
after
before
remove
empty
html()
method is used to change selected elements and attributes. It also brings the HTML contents (innerHTML) of the initially matched element. Below is the syntax for html method.
Syntax:
append()
method is used to insert the data at the end or as the last child of the matched element in the jQuery collection.
The append() and appendTo() methods are similar.
Syntax:
prepend()
method is used to insert the content at the starting or as the first child of the matched element. It is opposite of the jQuery append() method.
To insert the data at the end of the elements,use the append method.
Syntax:
after()
method is used to insert the content after matched element.This is similar to jQuery append() method.
To insert content before the selected element, use jQuery before() method.
Syntax:
before()
method is used to insert the content before matched element. It adds the content specified by the parameter, before each element in the set of matched elements.
Syntax:
remove()
method removes the selected HTML element from the DOM. It removes the selected element itself, as well as everything inside it (including all texts and child nodes). This method also removes the data and the events of the selected elements.
Syntax:
empty()
method. This method doesn't remove the element itself. To remove the element without removing data and events, use the method detach().
Syntax: