-1

i wanted to input time duration in hh:mm:ss format (example - 01:23:45) in html , pls suggest me the best method. Thanks in advance

How is it possible in html ? is there any direct input type available for that ? Please help !!

kalesh cv
  • 33
  • 4
  • Does this answer your question? [HTML input time in 24 format](https://stackoverflow.com/questions/32609407/html-input-time-in-24-format) – Chase Ingebritson Apr 17 '21 at 19:13

2 Answers2

0

You can use the default time tag in the html as below

 <time>10:00</time>

or if you want to input time using input tag and setting type to time

<input type="time" name="time" />
venkatesh
  • 162
  • 2
  • 6
0

Here you go check below code

<!DOCTYPE html>
<html>
    <body>
        Time: <input type="time" id="Time" value="01:23:45">

    <button onclick="myFunction()">Click to see the selected time</button>

    <p id="SeeTime"></p>

    <script>
        function myFunction() {
            var x = document.getElementById("Time").value;
            document.getElementById("SeeTime").innerHTML = x;
        }
    </script>
    </body>
</html>
Ammad Amir
  • 433
  • 3
  • 7