Answers for "html set value in select"

5

javascript set html select value

// Get the html select element
var select = document.getElementById('<your select element id>');

// If you have a <option> like this:
// <option value="1">My Value Display text</option>

//Then your selected value of your select would be:

select.value = "1";
Posted by: Guest on September-29-2020
8

select default value

<option selected>
5
</option>
Posted by: Guest on April-03-2020

Code answers related to "html set value in select"

Browse Popular Code Answers by Language