How to auto fill this two input without inputting?
<input type="time" name="Time" id="Time" value="" />
I want to automatically fill date and time without inputting according to the desktop date and time.
How to auto fill this two input without inputting?
<input type="time" name="Time" id="Time" value="" />
I want to automatically fill date and time without inputting according to the desktop date and time.
3
Answers
You can fill almost any input with its
value
property.In javascript:
For it to consume your system time create a date object and feed the hours and minutes to the input
You can do by javascript.
The code for HTML:
Here is the code for getting current time using javascript:
If you want to add this using javascript then:
document.querySelector(‘#time_’).value = current_time;
And if you want this in jquery then: