I've seen many threads about getting an array of option value but they're all done by id. Unfortunately, my select field does not have a proper id. How can I get an array of all values in the select tag by the name using Jquery?
<select name="groupa">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</select>
I'd expect a result like this:
[
'1' => 'A'
'2' => 'B'
'3' => 'C'
]
p/s: I've tried some similar codes but did not work.