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

javascript checkbox 有关问题

2011-12-27 
javascript checkbox 问题var A document.getElementById(A)//input typecheckbox idA怎么在

javascript checkbox 问题
var A = document.getElementById('A');//<input type="checkbox" id="A">

怎么在javascript中选中?

[解决办法]

HTML code
<BODY     onload= "iniCheckBox() ">       <c:forEach   var= "cc "   items= "${tcList   } ">                       <input   type= "checkbox "   name= "C1 "   value= "ON "   id= "${cc.charge_code   } "   >                                 ${cc.charge_name   }         </c:forEach> function   iniCheckBox()                 {         document.getElementById( "A ").checked=true;       } 页面源码:   收费项目:   <input   type= "checkbox "   name= "C1 "   value= "ON "   id= "A "   >     开户费     <input   type= "checkbox "   name= "C1 "   value= "ON "   id= "B "   >     漫游费   <input   type= "checkbox "   name= "C1 "   value= "ON "   id= "C "   >     押金   <input   type= "checkbox "   name= "C1 "   value= "ON "   id= "D "   >     入网费   <input   type= "checkbox "   name= "C1 "   value= "ON "   id= "E "   >     选号费   <p> 

热点排行