Chrome Extension

Get selected option text using jQuery

The code can be used to get the text of the selected option using jQuery.
var selected_text = $("select option:selected").text();
console.log(selected_text);

$(document).on("change", "select", function() {
    var option_text = $('option:selected', this).text();
    console.log(option_text);
});
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Was this helpful?
0 Comments