SlideShare a Scribd company logo

Javascript Write an event handler so that when the user clicks the Che.docx

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 Che.docx

1 of 1
Download to read offline
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:

Recommended

Job Costs Using Activity-Based Costing Heitger Company is a job-order.docx
Job Costs Using Activity-Based Costing Heitger Company is a job-order.docxJob Costs Using Activity-Based Costing Heitger Company is a job-order.docx
Job Costs Using Activity-Based Costing Heitger Company is a job-order.docxBenjaminIjsDaviesq
 
Jan sold her house on December 31 and took a $30-000 mortgage as part.docx
Jan sold her house on December 31 and took a $30-000 mortgage as part.docxJan sold her house on December 31 and took a $30-000 mortgage as part.docx
Jan sold her house on December 31 and took a $30-000 mortgage as part.docxBenjaminIjsDaviesq
 
Job Cost SheetAnswer the following questions- (a) What are the source.docx
Job Cost SheetAnswer the following questions- (a) What are the source.docxJob Cost SheetAnswer the following questions- (a) What are the source.docx
Job Cost SheetAnswer the following questions- (a) What are the source.docxBenjaminIjsDaviesq
 
Joel spends all of his monthly food budget on fast food and bther meal.docx
Joel spends all of his monthly food budget on fast food and bther meal.docxJoel spends all of his monthly food budget on fast food and bther meal.docx
Joel spends all of his monthly food budget on fast food and bther meal.docxBenjaminIjsDaviesq
 
Joe is an non-exempt employee who worked 39 hours in week 1 of the pay.docx
Joe is an non-exempt employee who worked 39 hours in week 1 of the pay.docxJoe is an non-exempt employee who worked 39 hours in week 1 of the pay.docx
Joe is an non-exempt employee who worked 39 hours in week 1 of the pay.docxBenjaminIjsDaviesq
 
Jimmy deposits $4-000 now- $2-6003 years from now- and $4-6006 years f.docx
Jimmy deposits $4-000 now- $2-6003 years from now- and $4-6006 years f.docxJimmy deposits $4-000 now- $2-6003 years from now- and $4-6006 years f.docx
Jimmy deposits $4-000 now- $2-6003 years from now- and $4-6006 years f.docxBenjaminIjsDaviesq
 
Joan borrowed $1800 and is to repay the balance plus interest of $50 i.docx
Joan borrowed $1800 and is to repay the balance plus interest of $50 i.docxJoan borrowed $1800 and is to repay the balance plus interest of $50 i.docx
Joan borrowed $1800 and is to repay the balance plus interest of $50 i.docxBenjaminIjsDaviesq
 
Jameson Corporation was organized on May 1- The following events occur.docx
Jameson Corporation was organized on May 1- The following events occur.docxJameson Corporation was organized on May 1- The following events occur.docx
Jameson Corporation was organized on May 1- The following events occur.docxBenjaminIjsDaviesq
 

More Related Content

More from BenjaminIjsDaviesq

Jia- a researcher in psychology and biobehavioral health- believes tha.docx
Jia- a researcher in psychology and biobehavioral health- believes tha.docxJia- a researcher in psychology and biobehavioral health- believes tha.docx
Jia- a researcher in psychology and biobehavioral health- believes tha.docxBenjaminIjsDaviesq
 
Jayco Inc- started its operations in 2016- Its sales- all on account-.docx
Jayco Inc- started its operations in 2016- Its sales- all on account-.docxJayco Inc- started its operations in 2016- Its sales- all on account-.docx
Jayco Inc- started its operations in 2016- Its sales- all on account-.docxBenjaminIjsDaviesq
 
Jenkins Company had the following information for the year- Jenkins Co.docx
Jenkins Company had the following information for the year- Jenkins Co.docxJenkins Company had the following information for the year- Jenkins Co.docx
Jenkins Company had the following information for the year- Jenkins Co.docxBenjaminIjsDaviesq
 
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docx
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docxJensen Tire & Auto is deciding whether to purchase a maintenance contr.docx
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docxBenjaminIjsDaviesq
 
Jennifer Martinez started a business and completed the following trans.docx
Jennifer Martinez started a business and completed the following trans.docxJennifer Martinez started a business and completed the following trans.docx
Jennifer Martinez started a business and completed the following trans.docxBenjaminIjsDaviesq
 
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docx
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docxJenry is a 40 year old woman with a body mass index (BMD) in the overw.docx
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docxBenjaminIjsDaviesq
 
Jefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docx
Jefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docxJefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docx
Jefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docxBenjaminIjsDaviesq
 
Jefferson Industries uses a job order cost system- On July 1 - work in.docx
Jefferson Industries uses a job order cost system- On July 1 - work in.docxJefferson Industries uses a job order cost system- On July 1 - work in.docx
Jefferson Industries uses a job order cost system- On July 1 - work in.docxBenjaminIjsDaviesq
 
Jayden Jewelers permits the return of their diamond wedding rings- pro.docx
Jayden Jewelers permits the return of their diamond wedding rings- pro.docxJayden Jewelers permits the return of their diamond wedding rings- pro.docx
Jayden Jewelers permits the return of their diamond wedding rings- pro.docxBenjaminIjsDaviesq
 
JavaScript question here- how do I create a Tip Calculator form with H.docx
JavaScript question here- how do I create a Tip Calculator form with H.docxJavaScript question here- how do I create a Tip Calculator form with H.docx
JavaScript question here- how do I create a Tip Calculator form with H.docxBenjaminIjsDaviesq
 
Java) For the following program- what are the possible outputs- public.docx
Java) For the following program- what are the possible outputs- public.docxJava) For the following program- what are the possible outputs- public.docx
Java) For the following program- what are the possible outputs- public.docxBenjaminIjsDaviesq
 
Java problem with code- will upvote- So I have two classes- import ja.docx
Java problem with code- will upvote- So I have two classes-  import ja.docxJava problem with code- will upvote- So I have two classes-  import ja.docx
Java problem with code- will upvote- So I have two classes- import ja.docxBenjaminIjsDaviesq
 
Java)The finally block introduces complications in the Java language s.docx
Java)The finally block introduces complications in the Java language s.docxJava)The finally block introduces complications in the Java language s.docx
Java)The finally block introduces complications in the Java language s.docxBenjaminIjsDaviesq
 
Java The files provided in the code editor to the right contain syntax.docx
Java The files provided in the code editor to the right contain syntax.docxJava The files provided in the code editor to the right contain syntax.docx
Java The files provided in the code editor to the right contain syntax.docxBenjaminIjsDaviesq
 
Java problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docx
Java problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docxJava problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docx
Java problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docxBenjaminIjsDaviesq
 
Java Interfaces An interface is a refercnce type in lava- It is simila.docx
Java Interfaces An interface is a refercnce type in lava- It is simila.docxJava Interfaces An interface is a refercnce type in lava- It is simila.docx
Java Interfaces An interface is a refercnce type in lava- It is simila.docxBenjaminIjsDaviesq
 
Java program Create the following program- A main() method that asks t.docx
Java program Create the following program- A main() method that asks t.docxJava program Create the following program- A main() method that asks t.docx
Java program Create the following program- A main() method that asks t.docxBenjaminIjsDaviesq
 
java please! Create class Date with the following capabilities- a) Out.docx
java please! Create class Date with the following capabilities- a) Out.docxjava please! Create class Date with the following capabilities- a) Out.docx
java please! Create class Date with the following capabilities- a) Out.docxBenjaminIjsDaviesq
 
Java Please Thank you! Also remember that -Prompt user- means print.docx
Java Please   Thank you! Also remember that -Prompt user- means print.docxJava Please   Thank you! Also remember that -Prompt user- means print.docx
Java Please Thank you! Also remember that -Prompt user- means print.docxBenjaminIjsDaviesq
 
java In the class definition- initialize the private fields owner (str.docx
java In the class definition- initialize the private fields owner (str.docxjava In the class definition- initialize the private fields owner (str.docx
java In the class definition- initialize the private fields owner (str.docxBenjaminIjsDaviesq
 

More from BenjaminIjsDaviesq (20)

Jia- a researcher in psychology and biobehavioral health- believes tha.docx
Jia- a researcher in psychology and biobehavioral health- believes tha.docxJia- a researcher in psychology and biobehavioral health- believes tha.docx
Jia- a researcher in psychology and biobehavioral health- believes tha.docx
 
Jayco Inc- started its operations in 2016- Its sales- all on account-.docx
Jayco Inc- started its operations in 2016- Its sales- all on account-.docxJayco Inc- started its operations in 2016- Its sales- all on account-.docx
Jayco Inc- started its operations in 2016- Its sales- all on account-.docx
 
Jenkins Company had the following information for the year- Jenkins Co.docx
Jenkins Company had the following information for the year- Jenkins Co.docxJenkins Company had the following information for the year- Jenkins Co.docx
Jenkins Company had the following information for the year- Jenkins Co.docx
 
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docx
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docxJensen Tire & Auto is deciding whether to purchase a maintenance contr.docx
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docx
 
Jennifer Martinez started a business and completed the following trans.docx
Jennifer Martinez started a business and completed the following trans.docxJennifer Martinez started a business and completed the following trans.docx
Jennifer Martinez started a business and completed the following trans.docx
 
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docx
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docxJenry is a 40 year old woman with a body mass index (BMD) in the overw.docx
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docx
 
Jefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docx
Jefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docxJefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docx
Jefferson Millinery Incorporated (JMI) decided to liquidate its wholly.docx
 
Jefferson Industries uses a job order cost system- On July 1 - work in.docx
Jefferson Industries uses a job order cost system- On July 1 - work in.docxJefferson Industries uses a job order cost system- On July 1 - work in.docx
Jefferson Industries uses a job order cost system- On July 1 - work in.docx
 
Jayden Jewelers permits the return of their diamond wedding rings- pro.docx
Jayden Jewelers permits the return of their diamond wedding rings- pro.docxJayden Jewelers permits the return of their diamond wedding rings- pro.docx
Jayden Jewelers permits the return of their diamond wedding rings- pro.docx
 
JavaScript question here- how do I create a Tip Calculator form with H.docx
JavaScript question here- how do I create a Tip Calculator form with H.docxJavaScript question here- how do I create a Tip Calculator form with H.docx
JavaScript question here- how do I create a Tip Calculator form with H.docx
 
Java) For the following program- what are the possible outputs- public.docx
Java) For the following program- what are the possible outputs- public.docxJava) For the following program- what are the possible outputs- public.docx
Java) For the following program- what are the possible outputs- public.docx
 
Java problem with code- will upvote- So I have two classes- import ja.docx
Java problem with code- will upvote- So I have two classes-  import ja.docxJava problem with code- will upvote- So I have two classes-  import ja.docx
Java problem with code- will upvote- So I have two classes- import ja.docx
 
Java)The finally block introduces complications in the Java language s.docx
Java)The finally block introduces complications in the Java language s.docxJava)The finally block introduces complications in the Java language s.docx
Java)The finally block introduces complications in the Java language s.docx
 
Java The files provided in the code editor to the right contain syntax.docx
Java The files provided in the code editor to the right contain syntax.docxJava The files provided in the code editor to the right contain syntax.docx
Java The files provided in the code editor to the right contain syntax.docx
 
Java problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docx
Java problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docxJava problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docx
Java problem 4-7 Figure 4-4c -7 (Corner point coordinates) Suppose a p.docx
 
Java Interfaces An interface is a refercnce type in lava- It is simila.docx
Java Interfaces An interface is a refercnce type in lava- It is simila.docxJava Interfaces An interface is a refercnce type in lava- It is simila.docx
Java Interfaces An interface is a refercnce type in lava- It is simila.docx
 
Java program Create the following program- A main() method that asks t.docx
Java program Create the following program- A main() method that asks t.docxJava program Create the following program- A main() method that asks t.docx
Java program Create the following program- A main() method that asks t.docx
 
java please! Create class Date with the following capabilities- a) Out.docx
java please! Create class Date with the following capabilities- a) Out.docxjava please! Create class Date with the following capabilities- a) Out.docx
java please! Create class Date with the following capabilities- a) Out.docx
 
Java Please Thank you! Also remember that -Prompt user- means print.docx
Java Please   Thank you! Also remember that -Prompt user- means print.docxJava Please   Thank you! Also remember that -Prompt user- means print.docx
Java Please Thank you! Also remember that -Prompt user- means print.docx
 
java In the class definition- initialize the private fields owner (str.docx
java In the class definition- initialize the private fields owner (str.docxjava In the class definition- initialize the private fields owner (str.docx
java In the class definition- initialize the private fields owner (str.docx
 

Recently uploaded

History in your Hands slides - Class 4 (online version).pptx
History in your Hands slides - Class 4 (online version).pptxHistory in your Hands slides - Class 4 (online version).pptx
History in your Hands slides - Class 4 (online version).pptxEilsONeill
 
Grantseeking Solo- Securing Awards with Limited Staff PDF.pdf
Grantseeking Solo- Securing Awards with Limited Staff  PDF.pdfGrantseeking Solo- Securing Awards with Limited Staff  PDF.pdf
Grantseeking Solo- Securing Awards with Limited Staff PDF.pdfTechSoup
 
Exit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docxExit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docxMYDA ANGELICA SUAN
 
HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)
HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)
HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)Rabiya Husain
 
UniSC Sunshine Coast library self-guided tour
UniSC Sunshine Coast library self-guided tourUniSC Sunshine Coast library self-guided tour
UniSC Sunshine Coast library self-guided tourUSC_Library
 
Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-PrincipleChromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principleblessipriyanka
 
Detailed Presentation on Human Rights(1).pptx
Detailed Presentation on Human Rights(1).pptxDetailed Presentation on Human Rights(1).pptx
Detailed Presentation on Human Rights(1).pptxDrOsiaMajeed
 
Evaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptxEvaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptxgarvitnanecha
 
EDL 290F Week 1 - Meet Me at the Start Line.pdf
EDL 290F Week 1 - Meet Me at the Start Line.pdfEDL 290F Week 1 - Meet Me at the Start Line.pdf
EDL 290F Week 1 - Meet Me at the Start Line.pdfElizabeth Walsh
 
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATIONUNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATIONSayali Powar
 
Media Relations for Public Relations Class
Media Relations for Public Relations ClassMedia Relations for Public Relations Class
Media Relations for Public Relations ClassCorinne Weisgerber
 
Website Fixer-Upper Series to Boost your Online Presence
Website Fixer-Upper Series to Boost your Online PresenceWebsite Fixer-Upper Series to Boost your Online Presence
Website Fixer-Upper Series to Boost your Online PresenceSamantha Russell
 
Appendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxAppendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxRenuka N Sunagad
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUSC_Library
 
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptxPractical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptxKatherine Villaluna
 
2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptx2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptxMaryPotorti1
 
IR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & TheoryIR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & Theorynivedithag131
 
The Institutional Origins of Canada’s Telecommunications Mosaic
The Institutional Origins of Canada’s Telecommunications MosaicThe Institutional Origins of Canada’s Telecommunications Mosaic
The Institutional Origins of Canada’s Telecommunications MosaicUniversity of Canberra
 

Recently uploaded (20)

History in your Hands slides - Class 4 (online version).pptx
History in your Hands slides - Class 4 (online version).pptxHistory in your Hands slides - Class 4 (online version).pptx
History in your Hands slides - Class 4 (online version).pptx
 
first section physiology laboratory.pptx
first section physiology laboratory.pptxfirst section physiology laboratory.pptx
first section physiology laboratory.pptx
 
Grantseeking Solo- Securing Awards with Limited Staff PDF.pdf
Grantseeking Solo- Securing Awards with Limited Staff  PDF.pdfGrantseeking Solo- Securing Awards with Limited Staff  PDF.pdf
Grantseeking Solo- Securing Awards with Limited Staff PDF.pdf
 
Exit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docxExit Essay - Save the Filipino Language by Renz Perez.docx
Exit Essay - Save the Filipino Language by Renz Perez.docx
 
HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)
HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)
HOW TO DEVELOP A RESEARCH PROPOSAL (FOR RESEARCH SCHOLARS)
 
UniSC Sunshine Coast library self-guided tour
UniSC Sunshine Coast library self-guided tourUniSC Sunshine Coast library self-guided tour
UniSC Sunshine Coast library self-guided tour
 
Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-PrincipleChromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principle
 
Capter 5 Climate of Ethiopia and the Horn GeES 1011.pdf
Capter 5 Climate of Ethiopia and the Horn GeES 1011.pdfCapter 5 Climate of Ethiopia and the Horn GeES 1011.pdf
Capter 5 Climate of Ethiopia and the Horn GeES 1011.pdf
 
Detailed Presentation on Human Rights(1).pptx
Detailed Presentation on Human Rights(1).pptxDetailed Presentation on Human Rights(1).pptx
Detailed Presentation on Human Rights(1).pptx
 
Evaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptxEvaluation and management of patients with Dyspepsia.pptx
Evaluation and management of patients with Dyspepsia.pptx
 
EDL 290F Week 1 - Meet Me at the Start Line.pdf
EDL 290F Week 1 - Meet Me at the Start Line.pdfEDL 290F Week 1 - Meet Me at the Start Line.pdf
EDL 290F Week 1 - Meet Me at the Start Line.pdf
 
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATIONUNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
UNIT 1 BIOMOLECULE_CARBOHYDRATES PRESENTATION
 
Media Relations for Public Relations Class
Media Relations for Public Relations ClassMedia Relations for Public Relations Class
Media Relations for Public Relations Class
 
Website Fixer-Upper Series to Boost your Online Presence
Website Fixer-Upper Series to Boost your Online PresenceWebsite Fixer-Upper Series to Boost your Online Presence
Website Fixer-Upper Series to Boost your Online Presence
 
Appendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptxAppendicular SkeletonSystem PPT.....pptx
Appendicular SkeletonSystem PPT.....pptx
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tour
 
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptxPractical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
Practical Research 1: Qualitative Research and Its Importance in Daily Life.pptx
 
2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptx2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptx
 
IR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & TheoryIR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & Theory
 
The Institutional Origins of Canada’s Telecommunications Mosaic
The Institutional Origins of Canada’s Telecommunications MosaicThe Institutional Origins of Canada’s Telecommunications Mosaic
The Institutional Origins of Canada’s Telecommunications Mosaic
 

Javascript Write an event handler so that when the user clicks the Che.docx

  • 1. 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: