jQuery Datepicker close datepicker after selected date
HTML <div class = "container" > <div class = "hero-unit" > <input type = "text" class = "dp" placeholder = "click to show datepicker" id = "example1" > </div> </div> jQuery (alternativ way) $ ( document ). ready ( function () { $ ( '#example1' ). datepicker ({ format : "dd/mm/yyyy" }); $ ( '.dp' ). on ( 'change' , function (){ $ ( '.datepicker' ). hide (); }); }); this is all you have to do :) HERE IS A FIDDLE to see whats happening.