Answers for "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
-1

jquery set select value

$("div.id_100 select").val("val2");
Posted by: Guest on October-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language