Using Javascript to input time in HTML5 time field
html, input, javascript, time
Solution
`hours":"minutes":"seconds` isn't concatenating the string, you need `+`s: `hours+":"+minutes+":"+seconds`
Problem
I'm trying to create a function in JS that will fill in the html5 `<input type=time>` with a format like this `hh:mm:ss`. ``` function timeChange(){ var d = new Date(); d.getHours(); d.getMinutes(); d.getSeconds(); var hours = d.getHours(); var minutes = d.getMinutes(); var seconds = d.getSeconds(); document.getElementById("time_in").value = (....); } ``` I'm not sure how to code the .value for this. I've tried using `.value = (hours":"minutes":"seconds);` but that just gives me a compile error. Anyone got ideas? I just need it in hh:mm:ss. HTML5 code: ``` <button type="button" onClick="timeChange()">Time</button> <input id="time_in" type="time" name="time_in"> ```