randomuser2
randomuser2

Reputation: 105

Timepicker from JQuery doesn't show up

Maybe someone already had the problem like mine - I want to use the Simple init DateTimePicker from this example . I created a simple php page:

<html>
<head>
<script src="js/jquery.js"></script>
<script src="js/jquery.datetimepicker.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.datetimepicker.css" />
<script>
jQuery('#datetimepicker').datetimepicker();
</script>
</head>
<body>
<input id="datetimepicker" type="text" >
</body>
</html>

I also put the jquery.datetimepicker.js and jquery.js in the js folder, same with css, however after refreshing the page - all I see is the empty input field and the datepicker doesn't show up. What am I doing wrong?

Upvotes: 1

Views: 579

Answers (1)

I&#39;m Geeker
I&#39;m Geeker

Reputation: 4637

Use document.ready function and make sure js are included correctly

<script>
jQuery(document).ready(function(){
jQuery('#datetimepicker').datetimepicker();
});
</script>

Upvotes: 4

Related Questions