muneebShabbir muneebShabbir - 6 months ago 63
jQuery Question

Setting format and value in input type="date"

Is there any way to set the format of

<input type="date" />
? if no then how can i set date in this field using JavaScript in the default format of
type="date"
. how can i get what will be the format of this field?

EDIT :
Actually i want to show native date-picker of mobile device that's why i picked this type of input. if is there any alternate for that field that also will b good to have.

Sorry if i said anything stupid. Please guide me

Answer

The format is YYYY-MM-DD. You cannot change it.

$('#myinput').val('2013-12-31'); sets value

Comments