SyntaxFix
Write A Post
Hire A Developer
Questions
As per the DOM structure you can use below code:
var x = document.getElementById('mySelect'); var txt = ""; var val = ""; for (var i = 0; i < x.length; i++) { txt +=x[i].text + ","; val +=x[i].value + ","; }