Get the label and value of each option. Change Selected option in Select2 Dropdown with jQuery. Loop through all options in a drop-down list, and output the text of each option: var x = document.getElementById("mySelect"); var txt = ""; var i; for (i = 0; i < x.length; i++) { txt = txt + x.options[i].text + "<br>"; } The result of txt will be: Apple Orange Pineapple Banana Try it Yourself Example I try to set selected in selection box value, the values are also call from ajax. is there a chinese version of ex. By using this site, you agree to the use of cookies, our policies, copyright terms and other conditions. I'm trying to understand how to iterate through the options in the