재우니의 블로그

<script type="text/javascript">
$(document).ready(function(){
$("#selectListButton1").click(function(){
alert( 'Value is: ' + $('#selectList').val() );
});
$("#selectListButton2").click(function(){
alert( 'Text is: ' + $('#selectList :selected').text() );
});
});
</script>



<select id="selectList">
<option value="1">First Option</option>
<option value="2">Second Option</option>
<option value="3">Third Option</option>
</select>

<button id="selectListButton1">Get Value</button>
<button id="selectListButton2">Get Text</button>