HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Option Object : Alert the value of the selected option in a drop-down list
The value property sets or returns the value of the option (the value to be sent to the server when the form is submitted).
Property | |||||
---|---|---|---|---|---|
value | Yes | Yes | Yes | Yes | Yes |
Return the value property:
Set the value property:
Value | Description |
---|---|
value | The value to be sent to the server |
Return Value: | A String, representing the value of the value attribute of the option element |
---|
Change the value of a specific option element:
document.getElementById("myOption").value = "newValue";
HTML reference: HTML <option> value attribute
❮ Option Object