What is the "append" method in jQuery?
In jQuery, the append() method is used to insert specified content as the last child (at the end of) the selected elements in the jQuery collection.
Within an HTML document, there are multiple elements. For each element, you might want to attach new elements or objects to an older element i.e. append() an element as the last child of an existing parent element.
The screen shows Hello in style h1
1 of 3
Syntax
First, we will look at the syntax of the append() method and see how it works.
Examples
The append() method has two implementations:
- The first implementation simply calls the
append()method as a function of the$(selector)and gives the element to be appended as the argument. The appended element can be an HTML or DOM element or a jQuery tag.
- The second implementation takes in a method as input instead of the element or content to be appended. In this case, the input method returns an element or content that is to be appended.
Note: If you keep on clicking the button, it will keep appending the text to the already created element.
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved