0
在下拉菜單中選擇「其他」選項後,我想在下拉菜單後出現一個新的輸入字段,但什麼也沒有發生。在下拉菜單中選擇選項後添加新的輸入字段
<div style="margin-right:20px" id='degree'>
<label for='college_name'>Degree</lable></br>
<select style="width: 400px" class='degree-selected'>
<option>High school</option>
<option>Bachler's degree</option>
<option>Master's degree</option>
<option>Doctor of philosophy (Ph.D)</option>
<option id='hello'>other</option>
</select>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#hello").click(function(){
alert('degree');
$('#degree').append('<div style="margin-right:20px;"><label for="college_name"></lable><input type="text" placeholder=""></div>');
});
});
</script>