I am trying to get the value of the selected option. However, there are 2 different select menus, using the same name and class. I want to be able to pull the text inside the value.
I already know which select option they choose, but I can't seem to get the value of the option.
This is the HTML
<div id="single_course" style="display: none;">
<SELECT class="form-control" name="course_choice">
<OPTION value="1">Value 1</OPTION>
<OPTION value="2">Value 2</OPTION>
<OPTION value="3">Value 3</OPTION>
</SELECT>
</div>
<div id="2day_course" style="display: none;">
<SELECT class="form-control" name="course_choice">
<OPTION value="1">Value 1</OPTION>
<OPTION value="2">Value 2</OPTION>
<OPTION value="3">Value 3</OPTION>
</SELECT>
</div>
This the JS Code
var course_choice = $('#register select[name=course_choice]').value;
Your advice is greatly appreciated!!