How to get selected option from Dropdown in jQuery ?
The val() method in jQuery is used to set or return the value of an attribute for the selected elements. This method applies to the HTML form elements.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
$(selector).val() // or $(selector).val(value) // or $(selector).val(function(index, current_value))
This method returns the selected element with specified changes made by val() method.
How does it work?
Whenever you select an item from the dropdown, it will show below the dropdown at the same time.