这是我的 JS
var linkArray = {
boothsizeDiv_link: false,
furnishingsprovidedDiv_link: false,
electricalDiv_link: false,
rentalfurnishingsDiv_link: false,
gesgraphicsDiv_link: false,
geslaborDiv_link: false,
contractorDiv_link: false,
carpetingDiv_link: false,
boothlightingDiv_link: false,
javitsDiv_link: false,
boothsealDiv_link: false,
mannequinsDiv_link: false,
calcDiv_link: false
};
for (var i in linkArray) {
if (linkArray['boothsizeDiv_link'] == false) {
document.getElementById('jumplinks').style.display = 'block';
document.getElementById('boothsizeDiv_link').style.display = 'block';
}
}
html是
<div id="jumplinks" align="left" style="display:none;">
<div id="boothsizeDiv_link" style="display:none;"><a href="#" onclick="ToggleLinks('boothsizeDiv');"><font face="calibri">BOOTHSIZE</font></a></div>
</div>
在我的 html 文件中,有 id 为的 divjumplinks
当style='display:none;'
我尝试运行 JS 文件时,它说的document.getElementById('jumplinks')
是null
. 问题是什么?需要帮忙..