这里我有一个代码,当我点击按钮时,我必须将新的 div ID 添加到 div ID 底部,但我不知道我错在哪里:
contentStr += '<button class="dodaj">Add to timeline</button></div>';
$(".dodaj").click(function() {
$('#bottom').append($('<div id="new">'+place.name+'</div>').css('marginLeft',100));
});
$(contentStr).dialog({ modal:true });
所以首先我在模态窗口 jquery UI 中调用 contentStr ,在这个模态窗口中我必须调用带有类 .dodaj 的按钮并进入 ID 底部以添加新的 div ID
那么这里有什么问题呢?