datepicker bootstrap add in htmlform code example

Example 1: How to add Datepicker in Bootstrap(HTML form)

<div class='container' style='margin-top: 100px;'>
 <input type='text' class="form-control" id='datepicker' style='width: 300px;' > <br>
 <input type='text' class="form-control" data-provide="datepicker" style='width: 300px;' >
</div>

<!-- Script -->
<script type="text/javascript">
$(document).ready(function(){
 $('#datepicker').datepicker(); 
});
</script>

Example 2: How to add Datepicker in Bootstrap(HTML form)

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>

<!-- Datepicker -->
<link href='bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' rel='stylesheet' type='text/css'>
<script src='bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' type='text/javascript'></script>

Tags:

Html Example