以下是 DIV 结构:
<div class="demo">
<div id="tabs">
<div id="tabs-1"></div>
<div id="tabs-2"></div>
</div></div>
如何从 JavaScript 访问“tabs-2”?
var plot2 = $.jqplot ('tabs-2', [points], {...
此 JavaScript 代码仅适用于第一级 DIV 容器,例如“演示”。
最佳答案
怎么样
document.getElementById('tabs-2')
?
关于javascript - 从 JavaScript 访问 DIV 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12248617/