Category: Jquery

Get date from datepicker not working as expected

I am trying to show an alert when someone selects a date in the past: jQuery(‘#date’).datepicker().change(evt => { var selectedDate = jQuery(‘#date’).datepicker(‘getDate’); var theSelectedDate = selectedDate.setHours(0,0,0,0);...

Ternary Operator for more than 2 conditions

var testCond = $(‘body’).hasClass(‘theme-a’) ? ‘a’ : ‘b’; Need to include new theme class name into the body like mentioned above. But, getting javascript error. Not...