Change the value of a specific option element:
document.getElementById("myOption").value = "newValue";
Click the button to change the value of the apple option.
<!DOCTYPE html> <html> <body> Select your favorite: <select> <option id="myOption" value="apple">Apple</option> <option value="orange">Orange</option> </select>/*w w w . j a v a 2 s.c o m*/ <button type="button" onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myOption").value = "newValue"; document.getElementById("demo").innerHTML = "The value changed."; } </script> </body> </html>