0

I'm a beginner in javascript I'm trying to get input value.

The alert only shows time(10:10) not with am or pm.
but I'm trying to print (10:10 am)

function calculateTime() {

  var start = $('#startTime').val();
  var start = $('#endTime').val();
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="time" class="form-control" id="startTime" name="startTime">
<input type="time" class="form-control" name="endTime" id="endtTime" onchange="calculateTime()">
mplungjan
  • 169,008
  • 28
  • 173
  • 236
Ghulam Haider
  • 133
  • 2
  • 12

0 Answers0