How to prepend a div to another div using javascript

Problem

I have 5 listviews with different id's and i am giving an header to each listview using class=".k-header". whenever i am running the code the headers are coming on top and the listviews are coming next. I want header for each list view on top of that.

I am using common listview css file for all the listviews.

How can i do that.

Regards

Problem courtesy of: Jonathan

Solution

Refer to the jQuery documentation about DOM insertion. Using insertBefore may help.

Solution courtesy of: Atanas Korchev

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.