Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript change select element

// Selecting the 3rd option (Demo 2)
const $select = document.querySelector('#mySelect');
$select.value = $select.querySelector('option')[2].value;
Source by alvarotrigo.com #
 
PREVIOUS NEXT
Tagged: #javascript #change #select #element
ADD COMMENT
Topic
Name
8+5 =