如何捕获div块中定义的HTML中的窗格元素? [英] How to catch the pane element in HTML defined in a div block?
本文介绍了如何捕获div块中定义的HTML中的窗格元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在div元素块中,我有几个像这样的dijit.TitlePane
In a div element block, I have several dijit.TitlePane like that
如果我切换其中一个,我想要其他人要关闭。我创建了一个函数:
onClick =togglePanes(this)
在这个函数中,我想设置每个窗格的open属性(比如open =false) 。但是我无法使用下面的任何一个来捕获元素:
document.getElementById [tocPane] //未定义
document.forms [0] .getElementById [tocPane] //为null或不是对象
如何捕获窗格元素?谢谢。
If I toggle one of them, I want others to be closed. I created a function:
onClick = "togglePanes(this)"
In this function, I want to setup set each pane's open property (like open="false"). But I could not get catch the element using either one of them below:
document.getElementById["tocPane"] // undefined
document.forms[0].getElementById["tocPane"] // is null or not an object
How to catch the pane element? Thanks.
推荐答案
尝试了document.getElementById(tocPane)它的工作原理。
Tried document.getElementById("tocPane") it works.
我认为你应该将标准jQuery库合并到你的javascript / html代码中这些
< script type =text / javascriptsrc =jquery.js>
i think you should incorporate the standard jQuery libs to your javascript/html codes like these
<script type="text/javascript" src="jquery.js">
(document).ready(function(){
});
(document).ready( function() {
} );
这篇关于如何捕获div块中定义的HTML中的窗格元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文