JS
$(document).ready(function () {
$('#issue_no').change(function()
{
alert('Value change to ' + $(this).attr('value'));
});
});
HTML
<select id='issue_no' name='issue_non'>
<option value='_empty' selected='selected' style='display:none;'></option>
<option value="ABC">Vol 1, No 1 (2012): Journal of JISRComputing</option>
</select>
Doesnt seem to work. Why?
why is alert not being displayed when changing the select value.
Make sure you’re referencing jQuery:
Wrap your code in a ready function:
Be sure to check your
id‘s and markup for correct structure:Write well-formatted JavaScript for ease of readability:
After all of this, it works: http://jsbin.com/obadub/edit#javascript,html
As always, make sure you don’t have problems elsewhere on your page.