aim is to count difference from two dates im still confuse why it wont work, cause i wrote a code from someone's tutorial.
<!Doctype html>
<html><body style='background:white;'><head><title>tugas akhir</title>
<meta charset='utf-8'>
<link rel='stylesheet' href='js/jquery-ui.js'>
<link rel='stylesheet' href='js/jquery.js'>
<link rel='icon' src='images/lmd.png'>
<link rel='stylesheet' type='text/css' href='css/me.css'>
<link rel='stylesheet' type='text/css' href='css/datepicker.css'>
<link rel='stylesheet' type='text/css' href='css/bootstrap.css'>
<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='tinymce/tinymce.min.js'></script>
<script type='text/javascript' src='js/bootstrap-datepicker.js'></script>
<script>
$(function() {
$( "#arr_date" ).datepicker({ dateFormat: 'dd-mm-yy' });
$( "#dep_date" ).datepicker({ dateFormat: 'dd-mm-yy' });
});
$('.button').click(function() {
var start = $('#arr_date').datepicker('getDate');
var end = $('#dep_date').datepicker('getDate');
var days = (end - start)/1000/60/60/24;
$('#ahir').val(days);
});
</script>
<script>
if (typeof jQuery != 'undefined') {
alert("jQuery library is loaded!");
}else{
alert("jQuery library is not found!");
}
</script>
</head>
<p>Choose your dates and hit <em>go</em>.</p>
<input type="text" id="arr_date">
<input type="text" id="dep_date">
<input type="text" id="hasil">
<button class="button">go</button>
</body>
</html>
i want to put the difference date value in id='hasil. i hope you guys can help my problem. Thank you
$('#akhir').val(days);;
: what isakhir
item? And remove the second;