<html> <body> <button onclick="var myDate = new Date(); alert(myDate.getSeconds());"> get seconds </button> </body> </html>