小陆同学

python 中文名:蟒蛇,设计者:Guido van Rossum

导航

jquery--监听checkbox多选框是否选中,展示输入框

<div>
    <input type="checkbox" id="addChoiceSelect" name="add_choice" onchange="javascript:oBtAddChoice();"> 是否添加姓名 &nbsp; &nbsp; &nbsp;
    <input type="text" name="name"  id="input_name" style="display:none;" placeholder="请输入名称">
</div>

 

function oBtAddChoice() {
   // 获取多选是否选中
   var is_addChoice = $("#addChoiceSelect").is(':checked')
   if (is_addChoice==true){
      document.getElementById("input_name").style.display = "";
   }
}

 

 

posted on 2020-04-17 23:28  小陆同学  阅读(2624)  评论(0编辑  收藏  举报