首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

关于nextSibling跟nodeValue

2012-10-09 
关于nextSibling和nodeValueinput typeradio nameradio1 valueA/Ainput typeradio namer

关于nextSibling和nodeValue

<input type="radio" name="radio1" value="A" />A

<input type="radio" name="radio1" value="B" />B

<input type="radio" name="radio1" value="C" />C

<input type="radio" name="radio1" value="D" />D

?

document.getElementsByName('radio1').item(0).nextSibling.nodeValue获取A的值

A也是个对象,不过是用nextSibling直接获得的
文档其实可以描绘为一个树形结构,Tree的每个节点表现为一个HTML标记或者HTML标记内的文本项。

nextSibling是获得当前对象的下一个对象
nodeValue是返回一个节点的值

热点排行