I was under the impression that I could get the value of a select input by doing this $(this).val(); and applying the onchange parameter to the select field.
It would appear it only works if I reference the ID.
…
I have a dynamically created select option using a javascript function. the select object is
<select name="country" id="country">
</select>
when the js function is executed, the "country" object is
<select name="country" id="…
$('#mySelectBox option').each(function() {
if ($(this).isChecked())
alert('this option is selected');
else
alert('this is not');
});
Apparently, the isChecked doesn't work. SO my question is what is the proper way to do this?
Thanks.