how to set date while type ="date".in jquery -


i want set date .i used .val() function not work in android.

<input name="casedate" id="casedate"  min="2000-01-01" value="" type="date"  class="casedate_h" > 

js:

 var = new date();  var day = ("0" + now.getdate()).slice(-2);  var month = ("0" + (now.getmonth() + 1)).slice(-2);  var today = now.getfullyear()+"-"+(month)+"-"+(day) ;  var = new date();  var day = ("0" + now.getdate()).slice(-2);  var month = ("0" + (now.getmonth() + 1)).slice(-2);  var today = now.getfullyear()+"-"+(month)+"-"+(day) ;  $('#casedate').val(today);   $("#casedate").attr("value", today); 

wrap code inside :

 $(document).ready(function(){     var = new date();      var day = ("0" + now.getdate()).slice(-2);     var month = ("0" + (now.getmonth() + 1)).slice(-2);      var today = now.getfullyear()+"-"+(month)+"-"+(day) ;     var = new date();      var day = ("0" + now.getdate()).slice(-2);     var month = ("0" + (now.getmonth() + 1)).slice(-2);      var today = now.getfullyear()+"-"+(month)+"-"+(day) ;      $('#casedate').val(today);      $("#casedate").attr("value", today); }); 

ourput

2013-08-26


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -