I am trying to get the "value" attribute in an tag (inside a tag.
My current code:
JavaScript:
var TheId = $('.nameofselect option:selected').val();
HTML:
<option value="123">Text value</option>
But this is returning the "Text value" of the option, not the actual value (i.e. 123) - which is what I need.
Thanks in advance
option:selected. Just$('.classofselect').val().class="nameofselect"in the<select>element?Text value... Quite confusing..