jQuery prepend()The jQuery prepend() method is used to insert the specified content at the beginning (as a first child) of the selected elements. It is just the opposite of the jQuery append() method. If you want to insert the content at the end of the selected elements, you should use the append method. Syntax: Parameters of jQuery prepend() method
Example of jQuery prepend() methodLet's take an example to demonstrate the jQuery prepend() method. Output: This is the first paragraph. This is the second paragraph. jQuery prepend() example 2Output: This is the first paragraph. This is the second paragraph.
jQuery prepend() example 3Output: Hello tutorialsinfo.com Hello Guys! Welcome to the best tutorial site. Here, "Hello" is the prepended text. Next TopicjQuery after()
|