I want to get name
of the select option, but it appears to be blank, demonstrated in codepen. Getting value
works though, so I want to get name
in the same manner.
As you can see, name
is different for each option so it cannot be added in the <select>
, and I want to avoid using data-
as it would require hard-coding this edge case into re-usable functions.
http://codepen.io/anon/pen/wJzQWW?editors=1010
<select>
<option name="" value="" selected>Or</option>
<option name="tags" value="123">And</option>
<option name="not-tags" value="123">Not</option>
</select>