Currently my code looks like this,
$("#select").change(function() {
var thes = $(this).attr('value');
var next = $('option[:selected]').next().attr('value');
alert(next);
});
and my select looks like this
<select id="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
I tried using alert the variable thes and it pops up but when I use the variable next it won't. What is wrong with my code? Please help.
.attr('value');can be replaced with.val()