Question

//* 1. Create a function called findMe() to handle the //* "Click Me" button's on click event. //...

//* 1. Create a function called findMe() to handle the
//* "Click Me" button's on click event.
//* 2. In the findMe() function, use input boxes "First Number" and
//* "Second Number" to receive user input.
//* 3. Output the bigger number to the form text box "output"
//* 4. function creation -
//* Use button to handle the event -
//* Use text boxes for input and output -
//* Insert your JavaScript answer for Question 3 from next line:

Must use this form:

<FORM NAME="myform">
Click here:<INPUT TYPE="button" VALUE="Click Me" > <BR>
First Number: <INPUT TYPE="text" NAME="input1" VALUE="" SIZE=10> <BR>
Second Number: <INPUT TYPE="text" NAME="input2" VALUE="" SIZE=10> <BR>
<INPUT TYPE="text" NAME="output" VALUE="" SIZE=10> is bigger!<BR>
</FORM>

0 0
Add a comment Improve this question Transcribed image text
Answer #1

<!DOCTYPE html>
<html>
<head>
<title>Greater number</title>
</head>
<body>
<FORM NAME="myform">
Click here:<INPUT TYPE="button" VALUE="Click Me" onclick="findMe()"> <BR>
First Number: <INPUT TYPE="text" NAME="input1" id="input1" VALUE="" SIZE=10> <BR>
Second Number: <INPUT TYPE="text" NAME="input2" id="input2" VALUE="" SIZE=10> <BR>
<INPUT TYPE="text" NAME="output" id="output" VALUE="" SIZE=10> is bigger!<BR>
</FORM>

</body>
<script>
   function findMe()
   {
       var num1, num2, num3;
  
       num1 = Number(document.getElementById("input1").value);
       num2 = Number(document.getElementById("input2").value);

       if(num1>num2)
       {
           document.getElementById("output").value=num1;
       }
       else
       {
           document.getElementById("output").value=num2;
       }
   }
</script>
</html>

Click here: Click Me First Number: 236 Second Number: 56 236 is bigger!

Add a comment
Know the answer?
Add Answer to:
//* 1. Create a function called findMe() to handle the //* "Click Me" button's on click event. //...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Develop the Change Calculator application In this exercise, you’ll create an application that displays the minimum...

    Develop the Change Calculator application In this exercise, you’ll create an application that displays the minimum number of quarters, dimes, nickels, and pennies that make up the number of cents specified by the user. Without the use of a JavaScript Library (for coins). 1.      Open the HTML and JavaScript files below: 2.      In the JavaScript file, note that three functions are supplied. The $ function. The start of a calculateChange function. And an onload event handler that attaches the calculateChange...

  • In an external JavaScript file, you need to create two global variables for the Quarter name...

    In an external JavaScript file, you need to create two global variables for the Quarter name array and the Sales amount array. Create an anonymous function and connect it to the onclick event of the Add to Array button that adds the values from the fields (Quarter and Sales) to the respective arrays. Create an anonymous function and connect it to the onclick event of Display Sales button displays the contents of the arrays, displays the sum of all the...

  • Create an HTML5 page that contains a form to collect the following data. The text in...

    Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date)   order_date First Name (text box)   first_name Last Name (text box)   last_name Payment type (drop down list)   payment_type – Visa, Master, Discover, Amex, and...

  • HELP! Event Handling- Develop an event handler to handle onclick Form Validation event when a user...

    HELP! Event Handling- Develop an event handler to handle onclick Form Validation event when a user clicks the submit button on the Survey Form. The event handler should validate the following: o The Name tesxt box should contain only Alphabets. o The Address text boxes should contain only appropriate numeric, alphabet or alphanumeric characters o Make sure at least two checkboxes are checked. o Make sure a radio button option is selected. o The Email Address should be valid. Validate...

  • Using Javascript, I have two radio buttons, depending on the value of the radio button 1...

    Using Javascript, I have two radio buttons, depending on the value of the radio button 1 or 2, you will send a different form to the user. So, if radio button is value "1" send new form1 or if value "2" send new form 2.  New form will ask for letter grades for four courses in textboxes. Onsubmit of new form letter grades A,B,C,D need to be changed to numeric values 1,2,3,4 so an average grade for the four couses can...

  • Can someone help fix this JAVASCRIPT code according to comment instructions javascriot code: window.addEventListener("click", () =>...

    Can someone help fix this JAVASCRIPT code according to comment instructions javascriot code: window.addEventListener("click", () => { console.log("You clicked?"); }); let button = document.querySelector("button"); button.addEventListener("click", () => { console.log("First Button clicked."); }); // How can we modify this so that it will occur when the 2nd button is clicked? // We need to use querySelectorAll which will produce a nodelist/array of all the buttons. Then we can reference which button we want to apply the click event using [] with...

  • Modify this code to store the form elements as variables and display them on the page...

    Modify this code to store the form elements as variables and display them on the page in an HTML table. <!DOCTYPE html> <html> <head> <script> function getValues() {     var result = ""; result += "First Name: " + document.forms["myForm"]["fname"].value + "<br>"; result += "Last Name: " + document.forms["myForm"]["lname"].value + "<br>"; result += "Address: " + document.forms["myForm"]["address"].value + "<br>"; result += "City: " + document.forms["myForm"]["city"].value + "<br>"; result += "State: " + document.forms["myForm"]["state"].value + "<br>"; document.getElementById("output").innerHTML = result; } </script>...

  • Hello! I am to create a .js file that allows the paragraph on the bottom of...

    Hello! I am to create a .js file that allows the paragraph on the bottom of the page to update with what the user enters. I need to modify the given HTML to recognize the javascript file that I am to make from scratch. The HTML file and other details are below: Use the given HTML to add functionality to an interactive form that generates an invitation to volunteers for an event. The file will have the following invitation message...

  • i'm having trouble with 1 and 3 using html, javascript and jquery 1) Change the "Search"...

    i'm having trouble with 1 and 3 using html, javascript and jquery 1) Change the "Search" link on the left to a button that when clicked, hide all the fields on the form and display the text "This is a search feature..." 3) When the user fills the form and clicks "Login", the values inputted should be displayed in the empty row (under Login) of the page. The display should be in the form: Student ID: <input value> Student Name:...

  • QUESTION 35 When you've created a data structure like this ____. var rect = {length: 9,...

    QUESTION 35 When you've created a data structure like this ____. var rect = {length: 9, width: 6}; you have created a direct instance of an object you have created an object using a custom constructor function you have created an object literal you have created an array literal QUESTION 38 "Once a web page has finished loading, then the ____ event handler fires." loaded onload complete done the language using in javascript QUESTION 29 You have this form. Assume...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT