我有这样的代码:
<tbody id="frm:r:0:s:tbody_element">
<tr>
<td>
<img id="frm:r:0:s:0:img_2" src="/example/img/ic_small_min.gif"
onclick="Expand(getID(this.id,'f'))" style="cursor: pointer;" />
- My Items
<span id="frm:r:0:s:0:f" style="DISPLAY: none;">
<input type="checkbox" name="frm:r:0:s:0:bcb" id="frm:r:0:s:0:bcb"
value="true" onclick="checkAll(this.form, this)" />
<table id="frm:r:0:s:0:mcb">
<tr><td><label><input type="checkbox" name="frm:r:0:s:0:mcb"
value="H321" /> List</label></td>
</tr>
<tr><td>
<label><input type="checkbox" name="frm:r:0:s:0:mcb"
value="H318" /> Edit</label></td>
</tr>
<tr><td><label><input type="checkbox" name="frm:r:0:s:0:mcb"
value="H310" /> Delete</label>
</td></tr>但是我试着getElementsbyid("frm:r:0:s:tbody_element").innerText,我得到了:
我的项目列表编辑删除
而不仅仅是
我的物品
为什么?
我想做的是只得到:我的项目
我不想在元素中得到所有的文本。
发布于 2014-01-17 00:33:13
'if doc = the loaded document
Set tb = doc.getElementById("frm:r:0:s:tbody_element")
Set els = tb.getElementsByTagName("td")(0).ChildNodes
Debug.Print els(1).NodeValue ' "- My Items"https://stackoverflow.com/questions/21168042
复制相似问题