jQuery before() Method
jQuery before() Method
The before() method is used to insert specified content in front of the selected elements. For inserting content after selected elements, we have to use the after() method.
Syntax:-
Its syntax is:-$(selector).before(content, function(index))
Return:-
Parameter | Description |
---|---|
content | Specifies the content to insert. |
function(index) | Optional. Specifies a function that returns the content to insert
|