checkbox简单问题,马上给分
<input id= "chkRole_0 " type= "checkbox " name= "chkRole:0 " /> <label for= "chkRole_0 "> 项目信息一览权限 </label>
JS如何如何获得“项目信息一览权限”这个内容?
document.getElementById( "chkRole_1 ").??
那个属性是什么?
------解决方案-------------------- <label for= "chkRole_0 " id= "lableaa "> ?目信息一??限 </label>
<script>
alert(document.getElementById( "lableaa ").innerText)
alert(document.getElementById( "lableaa ").innerHTML)
</script>
------解决方案-------------------- <input id= "chkRole_0 " type= "checkbox " name= "chkRole:0 " /> <label for= "chkRole_0 "> 项目信息一览权限 </label>
<script>
o = document.getElementsByTagName( "label ");
for(c=0;c <o.length;c++)
{
if(o[c].htmlFor== "chkRole_0 ") alert(o[c].innerText);
}
</script>