+ 3
Hello my question is can i fix value of box(list) name but not the options value.
https://code.sololearn.com/WiFJPRrP23Uv/?ref=app I want to declare name of list =options it shows value name.
1 Antwort
+ 1
With just HTML you must declare the value and the inner HTML, the text. If you want to capture the value of an option and show it on the inner HTML it involves JavaScript.
<select id="Example">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
var sel = document.getElementById("Example");
var value = sel.options[sel.selectedIndex].value;