prepend() in jQuery
This method is used to insert content at the beginning of each element in the set of specified matched elements.
Syntax 1
$(selector).prepend(content[,content])
- content - HTML string, DOM element, text node, array of elements and text nodes, or jQuery object to be inserted before each element in the set of matched elements.
Syntax 2
$(selector).prepend(function(index,currentElement))
- index - Index position of the element in the set.
- currentElement - old HTML value of the element.