开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜