Answers for "how to get selected text of dropdown in javascript"

1

get selected text of html dropdown in javascript

var e = document.getElementById("selectElementID");
var value=e.options[e.selectedIndex].value;// get selected option value
var text=e.options[e.selectedIndex].text;
Posted by: Guest on March-17-2020
0

get selected text of dropdown value

1
2
$( "#myselect option:selected" ).text();
// => "Mr"
Posted by: Guest on November-17-2021

Code answers related to "how to get selected text of dropdown in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language