SyntaxFix
Write A Post
Hire A Developer
Questions
Actually it is much more useful use the method that came with the library like this $(".datepicker").datepicker("clearDates");
$(".datepicker").datepicker("clearDates");
I recommend you to always take a look at the documentation of the library, here is the one I used for this.
bootstrap-datepicker methods documentation