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
精彩评论