Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Javascript Html sample Create a keyup event handler on the first text box. The event handler should execute a function that checks to see if

Javascript

Html sample


Create a keyup event handler on the first text box. The event handler should execute a function that checks to see if the key that was released is the enter key.

  • If it was, the function should get the string from this text box and find its length.

  • Then determine whether the strings length is even or odd and display the string, its the length and whether its even or odd back to the paragraph the webpage.


sample output after the user types in a string and presses enter:



Write an event handler so that when the user clicks the Compare Values button a function executes. This function should get each of the values from the second and third text boxes. If either number the user enters is ZERO you should print You entered 0 to the on the webpage. If the numbers are the same, you should print They each divide the other.

  • If the first number is evenly divisible by the second, you should print that to the screen.

  • If the second number is evenly divisible by the first number, you should print that to the screen. Otherwise, you should print that they are not divisible.


Sample output

image text in transcribed
image text in transcribed
image text in transcribed
Type a string and hit enter and we will tell you whether the length of your string is even or odd. Enter your string: Your string info will appear here Question 2 Enter two numbers and we will tell you if they are evenly divisible Enter your first number: Enter your second number: Output will appear here Enter two numbers and we will tell you if they are evenly divisible Enter your first number: Enter your second number: The first is divisible by the second. Enter two numbers and we will tell you if they are evenly divisible Enter your first number: Enter your second number: The second is divisible by the first. Enter two numbers and we will tell you if they are evenly divisible Enter your first number: Enter your second number: You entered a zero. Type a string and hit enter and we will tell you whether the length of your string is even or odd, Enter your string: The length of sunshine is 8 and it is even Type a string and hit enter and we will tell you whether the length of your string is even or odd. Enter your string: The length of Windy is 5 and it is odd

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

What is capital surplus?

Answered: 1 week ago

Question

outline some of the current issues facing HR managers

Answered: 1 week ago