Skip to main content
added 196 characters in body
Source Link
Niet the Dark Absol
  • 325.6k
  • 86
  • 480
  • 604
document.getElementById('sel').value; 

Should do the trick.

EDIT

var sel = document.getElementById('sel'); var opt = sel.options[sel.selectedIndex]; // now get attributes of opt, such as: console.log(opt.getAttribute("test")); 
document.getElementById('sel').value; 

Should do the trick.

document.getElementById('sel').value; 

Should do the trick.

EDIT

var sel = document.getElementById('sel'); var opt = sel.options[sel.selectedIndex]; // now get attributes of opt, such as: console.log(opt.getAttribute("test")); 
Source Link
Niet the Dark Absol
  • 325.6k
  • 86
  • 480
  • 604

document.getElementById('sel').value; 

Should do the trick.