If you want to use bootstrap datepicker then you need to use bootstrap datepicker library.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> //This library is for datepicker <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
Display datepicker:
<label>Date : </label> <input class="date-picker form-control" type="text"> <script type="text/javascript"> $('.date-picker').datepicker({ format: 'mm-dd-yyyy' }); </script>
This is very simple.You can try in your code.
Question and answer is powered by AnsPress.io