Get text of the selected option with jQuery [duplicate] Get text of the selected option with jQuery [duplicate] javascript javascript

Get text of the selected option with jQuery [duplicate]


Close, you can use

$('#select_2 option:selected').html()


$(document).ready(function() {    $('select#select_2').change(function() {        var selectedText = $(this).find('option:selected').text();        alert(selectedText);    });});

Fiddle


Change your selector to

val = j$("#select_2 option:selected").text();

You're selecting the <select> instead of the <option>