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"));