jQuery prepend() Method
jQuery prepend() Method
The prepend() method is used to insert specified content at the beginning of the selected elements. For inserting content at the end of the selected elements, we can use the append() method.
Syntax:-
Its syntax is:- $(selector).prepend(content, function(index, html))
Further Explanation:-
Parameter | Description |
---|---|
content | Required. Specifies the content to insert. |
function(index,html) | Optional. Specifies a function that returns the content to insert
|