我正在尝试更改类中的 HTML 属性
<div class="treeNodeStyle" id="trMenu_14" nowrap="" style="visibility: visible;">
<div class="treeNodeWrapperStyle" nowrap="">
<a class="treeInlineStyle" onclick="FolderExpand('trMenu','14');return false;" href="">
<img align="top" class="treeInlineStyle" src="/visimages/tree/plus.gif" border="0">
</a>
<div class="treeSelectorStyle" onclick="selectNode('trMenu','14',false)"
ondblclick="dblselectNode('trMenu','14')">
<img align="absmiddle" class="treeInlineStyleImg" src="/visimages/tree/folder.gif" border="0">
<div title="Finance" class="treeNodeTextStyle" nowrap="true"> Finance</div>
</div>
</div>
<div class=”treeChildStyle” nowrap=”” style=”display: none;”> </div>
最后一行代码是我需要更改的——从 style=”display: none ;” to style="display: block ;"</p>
这是我尝试使用的代码:
IE.Document.getElementsByClassName("treeChildStyle").removeAttribute ("style")
IE.Document.getElementsByClassName("treeChildStyle").setAttribute "style", "display: block;"