读书人

javascript checkbox 有关问题

发布时间: 2011-12-27 22:22:55 作者: rapoo

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> 

读书人网 >J2EE开发

热点推荐