监听checkbox事件


<!DOCTYPE html> <html> <head> <title></title> </head> <script> function onClickHander(obj){ if(obj.checked){ console.log("selected"); }else{ console.log("unselected"); } } </script> <body> <input id="checkBox" type="checkbox" onclick="onClickHander(this)"></input> </body> </html>

  

posted @ 2018-11-11 17:49  amberLIU  阅读(5459)  评论(0编辑  收藏  举报