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 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:

Recomendados

Job Costs Using Activity-Based Costing Heitger Company is a job-order.docx von
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
20 views1 Folie
Jan sold her house on December 31 and took a $30-000 mortgage as part.docx von
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
4 views1 Folie
Job Cost SheetAnswer the following questions- (a) What are the source.docx von
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
2 views1 Folie
Joel spends all of his monthly food budget on fast food and bther meal.docx von
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
3 views1 Folie
Joe is an non-exempt employee who worked 39 hours in week 1 of the pay.docx von
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
2 views1 Folie
Jimmy deposits $4-000 now- $2-6003 years from now- and $4-6006 years f.docx von
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
2 views1 Folie

Más contenido relacionado

Más de BenjaminIjsDaviesq

Jia- a researcher in psychology and biobehavioral health- believes tha.docx von
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
2 views1 Folie
Jayco Inc- started its operations in 2016- Its sales- all on account-.docx von
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
2 views1 Folie
Jenkins Company had the following information for the year- Jenkins Co.docx von
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
4 views1 Folie
Jensen Tire & Auto is deciding whether to purchase a maintenance contr.docx von
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
59 views2 Folien
Jennifer Martinez started a business and completed the following trans.docx von
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
3 views1 Folie
Jenry is a 40 year old woman with a body mass index (BMD) in the overw.docx von
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
2 views1 Folie

Más de BenjaminIjsDaviesq(20)

Jia- a researcher in psychology and biobehavioral health- believes tha.docx von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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 von BenjaminIjsDaviesq
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

Último

Relationship of psychology with other subjects. von
Relationship of psychology with other subjects.Relationship of psychology with other subjects.
Relationship of psychology with other subjects.palswagata2003
52 views16 Folien
CONTENTS.pptx von
CONTENTS.pptxCONTENTS.pptx
CONTENTS.pptxiguerendiain
62 views17 Folien
When Sex Gets Complicated: Porn, Affairs, & Cybersex von
When Sex Gets Complicated: Porn, Affairs, & CybersexWhen Sex Gets Complicated: Porn, Affairs, & Cybersex
When Sex Gets Complicated: Porn, Affairs, & CybersexMarlene Maheu
85 views73 Folien
Collective Bargaining and Understanding a Teacher Contract(16793704.1).pptx von
Collective Bargaining and Understanding a Teacher Contract(16793704.1).pptxCollective Bargaining and Understanding a Teacher Contract(16793704.1).pptx
Collective Bargaining and Understanding a Teacher Contract(16793704.1).pptxCenter for Integrated Training & Education
95 views57 Folien
Java Simplified: Understanding Programming Basics von
Java Simplified: Understanding Programming BasicsJava Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsAkshaj Vadakkath Joshy
322 views155 Folien
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx von
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxISSIP
386 views50 Folien

Último(20)

Relationship of psychology with other subjects. von palswagata2003
Relationship of psychology with other subjects.Relationship of psychology with other subjects.
Relationship of psychology with other subjects.
palswagata200352 views
When Sex Gets Complicated: Porn, Affairs, & Cybersex von Marlene Maheu
When Sex Gets Complicated: Porn, Affairs, & CybersexWhen Sex Gets Complicated: Porn, Affairs, & Cybersex
When Sex Gets Complicated: Porn, Affairs, & Cybersex
Marlene Maheu85 views
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx von ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP386 views
Monthly Information Session for MV Asterix (November) von Esquimalt MFRC
Monthly Information Session for MV Asterix (November)Monthly Information Session for MV Asterix (November)
Monthly Information Session for MV Asterix (November)
Esquimalt MFRC72 views
Education and Diversity.pptx von DrHafizKosar
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar193 views
AUDIENCE - BANDURA.pptx von iammrhaywood
AUDIENCE - BANDURA.pptxAUDIENCE - BANDURA.pptx
AUDIENCE - BANDURA.pptx
iammrhaywood117 views
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx von Ms. Pooja Bhandare
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptxPharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Ms. Pooja Bhandare113 views
Drama KS5 Breakdown von WestHatch
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch98 views
Class 9 lesson plans von TARIQ KHAN
Class 9 lesson plansClass 9 lesson plans
Class 9 lesson plans
TARIQ KHAN51 views
REPRESENTATION - GAUNTLET.pptx von iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood138 views
Solar System and Galaxies.pptx von DrHafizKosar
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptx
DrHafizKosar106 views
Create a Structure in VBNet.pptx von Breach_P
Create a Structure in VBNet.pptxCreate a Structure in VBNet.pptx
Create a Structure in VBNet.pptx
Breach_P78 views

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: