function getSel() { var sel = document.getElementById("doc_type"); var txt = sel.options[sel.selectedIndex].value; console.log(txt); }