I'm trying to get not just the value of the option element, but the value of the label attribute as well. Any ideas on how to do it? I'm currently using this (inline) to get the option's value:
$('select :selected').html(); My select would look something like this:
<select> <option value="John Smith" label="JS">John Smith</option </select> Any ideas? I've been looking for the last half-hour or so and some solutions have come close, but I can't find anyone who is looking for the value of the label.
Here's one that I thought would answer my question, but I think they were after something slightly different. - How to get label of select option with jQuery?
Thanks in advance!