<html> <body> <button onclick="var myDate = new Date(); alert(myDate.getFullYear());"> Date: get Full Year</button> </body> </html>