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

 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!