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

时间:2020-04-18 00:18:55   收藏:0   阅读:209
<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 = "";
   }
}

 技术分享图片

 

原文:https://www.cnblogs.com/lutt/p/12723368.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!