Answers for "set today date to input date using javascripy"

1

html input date default today

<!-- HTML -->
<input type="date" class="today">

<script>
  // JQuery
  $(document).ready( function() {
    $('.today').val(getToday());
  });
  
  function getToday(){
	const local = new Date();
    local.setMinutes(local.getMinutes() - local.getTimezoneOffset());
	return local.toJSON().slice(0,10);
  }
</script>
Posted by: Guest on September-03-2021
0

html print today date

<input type='date' id='hasta' value='<?php echo date('Y-m-d');?>'>
Posted by: Guest on February-09-2021

Code answers related to "set today date to input date using javascripy"

Browse Popular Code Answers by Language