开发者

How to add div inside other div in gallery script using jQuery?

I want to add a <div> inside a <div class="ad-image"> - How can it be done?

Gallery script is here: http://coffeescripter.com/code/ad-gallery/

This is the way I created <div class="开发者_StackOverflow社区ad-image">

var img_container = $(document.createElement('div')).addClass('ad-image');


var img_container = $(document.createElement('div')).addClass('ad-image'),
    new_div = $("<div></div>");

img_container.append(new_div);


You can do it by

$(".ad-image").append("<div>New div here</div>")


$('<div class="ad-image" />').appendTo($('div'));

Working jsfiddle: JsFiddle demo

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜