Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript select change selected

const options = Array.from(select.options);
options.forEach((option, i) => {
  if (option.value === use_id) select.selectedIndex = i;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #select #change #selected
ADD COMMENT
Topic
Name
6+1 =