开发者

How to append the data at the top of the div using jquery

开发者 https://www.devze.com 2023-02-12 16:50 出处:网络
i have some content in the div and i need to append some data at the top of the previous content inside that di开发者_StackOverflow中文版v by moving the remaining content down after a jquery function

i have some content in the div and i need to append some data at the top of the previous content inside that di开发者_StackOverflow中文版v by moving the remaining content down after a jquery function call.

thanks in advance


$("#mydiv").prepend(Data)

:)

That should do the trick :)


Use the prepend command: http://api.jquery.com/prepend/

$('#yourDivId').prepend(yourContent);


if you are using ajax call and want to set content at the top of div simply use $('#divId').(AjaxContent);

This will work.

0

精彩评论

暂无评论...
验证码 换一张
取 消