JQuery version: 1.4 onwards you can use callback function as the argument. Where you can get arguments as index position of the element in the set and the old HTML value of the element. Within the function, this refers to the current element in the set.
Prepending an element to a container
Both solutions are prepending the element #child (adding at the beginning) to the element #parent.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0