当前位置: 代码迷 >> J2EE >> javascript checkbox 有关问题
  详细解决方案

javascript checkbox 有关问题

热度:100   发布时间:2016-04-22 02:50:11.0
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>