Answers for "js get all select options"

1

js get all select options

var options = document.getElementById('mySelectID').options;
for (let i = 0; i < options.length; i++) { 
  console.log(options[i].value);//log the value
}
Posted by: Guest on August-05-2019
2

javascript get all select options

//looping through options select with jQuery
$("#mySelectID option").each(function(){
    var thisOptionValue=$(this).val();
});
Posted by: Guest on August-05-2019
0

javascript get all options from select

x.options.length
Posted by: Guest on September-07-2020

Code answers related to "js get all select options"

Code answers related to "Javascript"

Browse Popular Code Answers by Language