Question: javascript Write an event handler so that when the user clicks the Compare Values button a function executes. This function should get each of the
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

Enter two numbess and we will tell you if they are evenly divisible Enter two numbers and we will tell you if they are erenly drvisible. Enter your fint number: Enter your second numbet Enter your first number- The fint is divisible by the second. Eater your second number Enter two numbers and we will tellyou if they are evenly divisible They are each divimble by the ocher Enter your first number: Enter two numbers and we whil tell you if they are evenly dipisble Entet your second numbet Enter your first aumber? The second is druisble by the first. Enter your second number Enter rwo numbers and we will tell you if they are cvenly divisble Enter your first aumber: Enter your yocond number 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
