這是我的下拉菜單。代碼似乎沒問題,沒有錯誤,但它不會提示菜單中的選定項目。popup下拉菜單選擇
$(document).ready(function() {
// this function is triggered as soon as something changes in the form
$("select[name='inptPAN']").change(function() {
//console.log('found change');
alert($(this).val());
});
}
HTML:
<div id='selectPopup'>
<form name='test'>
<select id='inptPAN' name='inptPAN'>
<option value='1'>item 1</option>
<option value='2'>item 2</option>
<option value='3'>item 3</option>
<option value='4'>item 4</option>
<option value='5'>item 5</option>
<option value='6'>item 6</option>
</select>
</form>
</div>
感謝,它是好的,將選擇回答 –