Create a paragraph element with some text and append it to end of document body using jQuery
In this article, we will create a paragraph element with some text and append it to the end of the document body using jQuery. To append some text at the end of the document body, we use add() and appendTo() methods. The jQuery add() method is used to add elements to the existing group of elements. This method can add elements to the whole document, or just inside the context element if the context parameter is defined.
The jQuery appendTo() is an inbuilt method that is used to insert an HTML element at the end of the selected element.
Before Click Button:
After Click Button:
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.