xxxxxxxxxx
$("id or class")
.off('change')
.change(function()
{
var value = $(this)
.children("option:selected")
.val();
console.log(value);
});
as simple as that
xxxxxxxxxx
var conceptName = $('#idOfselect').find(":selected").val();
xxxxxxxxxx
$("select.your-select").change(function(){
$(this).children("option:selected").val();
});
xxxxxxxxxx
$('#dropdown').on('change', function() {
var selected_option_value = $(this).find(":selected").val();
});
xxxxxxxxxx
var selectedOptionText = $('#mySelectID').find(":selected").text();//selected option text
var selectedOptionVal = $('#mySelectID').find(":selected").val();//selected option value
xxxxxxxxxx
var conceptName = $('#aioConceptName').find(":selected").text();
xxxxxxxxxx
// Get the selected text from the <select> element
var selectedText = $('#mySelect option:selected').text();
// Log the selected text to the console
console.log(selectedText);
xxxxxxxxxx
<select id="state">
<option value="state1" data-id="1">state1</option>
<option value="state2" data-id="2">state2</option>
<option value="state3" data-id="3">state3</option>
</select>
$('#state option[data-id="2"]').val();
//output state2
xxxxxxxxxx
// Assuming you have a <select> element with an id "mySelect"
var selectedValue = $('#mySelect').val();
console.log(selectedValue);