我正在创建一个作为 html 元素集的传单弹出窗口:
var popupBox = document.createElement('div');
$(popupBox)
.addClass('popup-box')
.attr("id", "mypopup");
var popupBoxContent = document.createElement('div');
$(popupBoxContent)
.addClass('some-class')
.html('foo')
.appendTo(popupBox);
myLeafletObject.bindPopup(popupBox);
不幸的是,我以后无法访问这些元素。例如尝试做:
$('popup').append(someNewHTMLElement)
失败。有人可以帮忙吗?