使用jquery 1.10.2 我想删除包含交叉图像的div元素。下面给出的代码仅适用于第一个动态创建的div
$('#cross').on("click",function(e){
jsPlumb.detachAllConnections($(this).parent());-->detaching jsplumb connections
$(this).parent().remove();-->cross image is contained in the div element i want to delete
e.stopPropagation();
});
答案 0 :(得分:0)
将侦听器附加到文档。
将#cross
替换为您需要的内容。
$(document).on("click","#cross",function(e){
jsPlumb.detachAllConnections($(this).parent());-->detaching jsplumb connections
$(this).parent().remove();-->cross image is contained in the div element i want to delete
e.stopPropagation();
});