jquery - Bootstrap calendar not accessible through class -
i have table have use bootstrap calendar in particular columns in rows. using id calendar cumbersome. decided assign class calendar , tried accessing calendar unfortunately doesn't pop-up. while same code when hard-coded id's work perfectly. here code snippet using:-
<script> $(document).ready(function() { $(".datepicker").datepicker({ autoclose: true, startdate: new date() }); }); </script>
<td> <div class="form-group"> <div class="input-group datepicker date"> <input type="text" class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </td>
this code works absolutely fine copy code , save xhtml page , can see calendar displayed
<?xml version="1.0" encoding="iso-8859-1" ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" /> <title>bootstrap code calendar</title> </head> <body> <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <script type="text/javascript"> $(function () { $('.datetimepicker1').datetimepicker(); }); </script> </div> </div> </body> </html>
Comments
Post a Comment