Reputation: 871
i have some content in the div and i need to append some data at the top of the previous content inside that div by moving the remaining content down after a jquery function call.
thanks in advance
Upvotes: 22
Views: 27181
Reputation: 21
if you are using ajax call and want to set content at the top of div simply use $('#divId').(AjaxContent);
This will work.
Upvotes: -1
Reputation: 10850
Use the prepend command: http://api.jquery.com/prepend/
$('#yourDivId').prepend(yourContent);
Upvotes: 10