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 = "";
   }
}

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM