Check if selected dropdown value is empty using jQuery
You need to use .change()
event as well as using #
to target element by id
:
$('#EventStartTimeMin').change(function() {
if($(this).val()===""){
console.log('empty');
}
});
Fiddle Demo
You forgot the #
on the id selector:
if ($("#EventStartTimeMin").val() === "") {
// ...
}
You can try this also-
if( !$('#EventStartTimeMin').val() ) {
// do something
}