<div>
<input type="checkbox" id="addChoiceSelect" name="add_choice" onchange="javascript:oBtAddChoice();"> 是否添加姓名
<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 = ""; } }