Prev Demo
JavaScript
>
Setseconds() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to set the Seconds of a date object.</p> <input type="button" value="Click" onclick="myDate()" /> <p id="myId"></p> <script> function myDate() { var A = new Date(); A.setSeconds(54); document.getElementById("myId").innerHTML = A; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output