Solution 1 :

You can use the onchange event of the select element and store this value in a variable, which you can display some place else

Solution 2 :

Try using jQuery:

$("#selectbox_id option:selected").text();

and to get the selected option value

$("#selectbox_id option:selected").val();

selectbox_id is the id attribute <select id=""> of your select element

Source: https://learn.jquery.com/using-jquery-core/faq/how-do-i-get-the-text-value-of-a-selected-option/

Problem :

I have created a drop down list in html (select element).I want to show the selected option somewhere else in the html how to get it please see the image by clicking here. Could you please tell me how to get the result in front of class in “your id” part.

Comments

Comment posted by w3schools.com/jsref/event_onchange.asp

This is a dynamic behaviour. You need Javascript for this. Define a function that sets the value of some text (lookup html element by ID) and call it upon select’s onchange event.

By