Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript change select element

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