user1865719 user1865719 - 26 days ago 6x
CSS Question

Bootstrap datetimepicker for the id of div

I have the date picker working when I set the id for the input tag like the following:

<div class="col-sm-4" id="datepicker">
<input type="text" class="form-control" id="inputDate" placeholder="Date">
<span class="glyphicon glyphicon-calendar form-control-feedback" aria-hidden="true"></span>

<script type="text/javascript">
$(function () {

I just wonder why its not working if I used the div instead of the input tag ( the datepicker id), as I saw some examples online using the div instead of the input.


It wont work if you don't set class input-group on <div>

Check it here