$('#fromtime').on('change', function(){ var totimeValues = []; var fromTime = $(this).val(); $('#totime option').filter(function() { return $(this).val() <= fromTime; }).prop('disabled', true); });