码上敲享录 > jsp开发经验分享 > input checkbox框选中事件

input checkbox框选中事件

上一章章节目录下一章 2020-02-25已有7859人阅读 评论(0)

1.多个input type=checkbox框绑定选中事件

$(function(){

      var checkbox = $("input[type='checkbox']");

      checkbox.each(function(i) {

          $(this).click(function(){

             if(this.checked==true){

                 alert("选中");

             }else {

                 alert("取消选中");  

             }

          });

     });

 })



2.checkbox复选框,如何让其勾选时触发一个事件,取消勾选时不触发

 <input type="checkbox" onclick="checked(this)" />

 function checked(checkbox){

      if ( checkbox.checked == true){

           alert("选中");

      }else{

           alert("取消选中");

      }

 }



向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
1

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交