我正在创建一个小册子弹出窗口作为一组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)
失败。有人可以帮忙吗?