Javascript Write an event handler so that when the user clicks the Check Year button, a function executes. This function should get a four digit year from the user and print out to the webpage whether or not the year is a leap year. The first step is to validate the user input. This is done by checking to make sure the user enters a year larger than or equal to 1582. If the year is less, you should print an error message to the page. Otherwise, you need to determine if the year the user entered is a leap year. A year is a leap year if it is divisible by four, unless it is also divisible by 100 but not divisible by 400. Then print to the page whether the year is a leap year or not. Enter a year later than 1582 and we will tell you if it is leap year Enter a year later than 1582 and we will tell you if it is leap year Enter your year: Enter your year: 1400 is invalid 1900 is not a leap year Enter a year later than 1582 and we will tell you if it is leap year Enter a year later than 1582 and we will tell you if it is leap year Enter your year- Enter your year: 2003 is not a leap year 2000 is a leap year. Enter a year later than 1582 and we will tell you if it is leap year Enter your year: 2004 is a leap year: .
Javascript Write an event handler so that when the user clicks the Check Year button, a function executes. This function should get a four digit year from the user and print out to the webpage whether or not the year is a leap year. The first step is to validate the user input. This is done by checking to make sure the user enters a year larger than or equal to 1582. If the year is less, you should print an error message to the page. Otherwise, you need to determine if the year the user entered is a leap year. A year is a leap year if it is divisible by four, unless it is also divisible by 100 but not divisible by 400. Then print to the page whether the year is a leap year or not. Enter a year later than 1582 and we will tell you if it is leap year Enter a year later than 1582 and we will tell you if it is leap year Enter your year: Enter your year: 1400 is invalid 1900 is not a leap year Enter a year later than 1582 and we will tell you if it is leap year Enter a year later than 1582 and we will tell you if it is leap year Enter your year- Enter your year: 2003 is not a leap year 2000 is a leap year. Enter a year later than 1582 and we will tell you if it is leap year Enter your year: 2004 is a leap year: .