I have this field that asks for a date in an iPhone HTML App:
<input type="date" name="DepartureDate" id="DepartureDate" placeholder="Date" value="" class="bookingField" />
This script:
var ddate1 = $('#DepartureDate').val();
alert(ddate1);
returns this value: 2012-12-01 (when I select this date of course). Now can I can convert “ddate1” to look like 01/12/2012 ?
This should do the job, demo at jsFiddle.