JS面向对象之多选框实现(2)

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="https://www.jb51.net/js/Utile.js"></script> <script src="https://www.jb51.net/js/UIComponent.js"></script> </head> <body> <script> document.addEventListener(RES.DATA_FINISH_EVENT,init); RES.init(["new_icon"],"img/","xml"); function init() { var elem=document.createDocumentFragment(); document.addEventListener("change",changeHandler); var check=new CheckBox(elem); check.checked=true; check.label="男"; var check1=new CheckBox(elem); check1.label="女"; document.body.appendChild(elem); } function changeHandler(e) { console.log(e); } </script> </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/16b629a2ec1a42b38aeebb0597dc9d8f.html