In this tutorial, Learn how to get select box option value on using jQuery. Find multiple select box option value in jQuery. Multiple select box select multiple options by holding the key control and left mouse button.

You have to use the jquery change method to Get Select Box Option Value on select of the options. However, there are two types of select box. The first is the single option selection select box and other is the multiple option select box. You may also like how to show/hide div on dropdown selected using jQuery.

For the single select box, you can select the only single option and be using the script you can get that selected single option value. But in the multiple option select box, you can select multiple options and get a value of multiple selected options using the script given here.

How to Get Select Box Option Value on Select Using jQuery

If you want to get the value of the selected option for the single select box. You have to use the change function of jQuery which gives you the event of on select of the option of a select box.

Output


Choose your option from the select box given above.

Select the option from the select box given above. You will get the value of the selected option in the alert message box. This is the simple yet efficient script to get the value of the selected option and use in your coding.

If you want to find the multiple selected option from the multiple select boxes, then keep reading to find the answer of how to get multiple select box selected option value using jQuery.

How to Get Multiple Select Box Option Value on Multiple Select Using jQuery

In addition, to find the value of the single select box, you can find the value for the multiple selected options. For this, you have to use the multiple select boxes by using the attribute multiple in the HTML <select> tag.

The below-given script is the same script as we have using to get the single select box option value. But the script finds the change event of the multiple select boxes and gives the value in an array format.

Output

Note: To select multiple value press ctrl+ mouse click the option.

Choose your option from the select box given above.

Select multiple options from the multiple select options box given above. You will get the multiple values in an array format in the alert message box. You need to press both the control key of the keyboard and the left mouse button to select multiple values.

Hope, you like this tutorial. If you have any query, please comment below to ask.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.