Develop and test html document that has checkboxes for apple

Assignment Help JAVA Programming
Reference no: EM13968794

This is a Javascript assignment - 6 questions.

1.  Rewrite the below document to assign the event handler to the event property of the button element. This requires the chosen color to be obtained from the value property of the button element rather than through the parameter.

This is the HTML document

<!DOCTYPE html>

<!-- 5.1.hmtl

     A document for color_click.js

     -->

<html lang = "en">

  <head>

    <title> 5.1.html </title>

    <meta charset = "utf-8" />

    <script type = "text/javascript"  src = "color_click.js" >

    </script>

  </head>

  <body>

    <h4> Favorite Color </h4>

    <form id = "myForm"  action = "">

      <p>

        <label> <input type = "radio"  name = "colorButton"  

                       value = "10"   

                       onclick = "colorChoice(10)" />

       Color red </label>

        <br />

        <label> <input type = "radio"  name = "colorButton"  

                       value = "20"

                       onclick = "colorChoice(20)" />

        Color blue </label>

        <br />

        <label> <input type = "radio"  name = "colorButton"  

                       value = "30"

                       onclick = "colorChoice(30)" />      

      Color green </label>

        <br />

        <label> <input type = "radio"  name = "colorButton"  

                       value = "40"

                       onclick = "colorChoice(40)" />

       Color yellow </label>

        <br />

        <label> <input type = "radio"  name = "colorButton"  

                       value = "50"

                       onclick = "colorChoice(50)" />

        Color orange </label>

        </p>

    </form>

  </body>

</html>

(This is the JS external file)

// color_click.js

//   An example of the use of the click event with radio buttons,

//   registering the event handler by assignment to the button

//   attributes

// The event handler for a radio button collection

function colorChoice (color) {

// Produce an alert message about the chosen airplane

  switch (color) {

    case 10: 

      alert("Favorite color red");

      break;

    case 20: 

      alert("Favorite color blue");

      break; 

    case 30:

      alert("Favorite color green");

      break; 

  case 40:

      alert("Favorite color yellow");

  case 50:

      alert("Favorite color Orange"); 

      break; 

    default:

      alert("Error in JavaScript function colorChoice");

      break;

  }

}

2.  Develop and test an HTML Document that has checkboxes for apple (59 cents each), oranges (49 cents each), and Banana (39 cents each), along with a submit button. each of the checkboxes should have its own o'clock event handler. these handlers must add the cost of their fruit to a total cost. An Event handler for the submit button must produce an alert window with the message your total cost is $xx, where xxx is the total cost of the chosen fruit, including 5% sales tax. this handler8 must return false (to avoid actual submission of the form data).

3. Develop and test an HTML document that is similar to exercise 5.3. in this case use test boxes rather than checkboxes. these text boxes take a number which is the purchase number of the particular fruit. the rest of the document should behave exactly like that of exercise 5.3

4. Add reality checks to the text boxes of the document in exercise 5.4. the checks on the text box inputs should ensure that the input values are numbers in the range from 0 to 99

5. Range checks for element inputs can be represented as new properties of the object that represents the element. Modify the document in excesses 5.5 to add a max property value of 99 and a min property value of 0. Your event handler must use the properties for the range checks on values input through the text boxes.

6. Develop and test an html document that collects the following information from the user: Last name, first name, middle initial, age (restricted to be greater than 17), and weight (restricted to the range from 80 to 300). You must have event handlers for the form elements that collect this information. This handlers must check the input data for correctness. message in an alert windows must be produced when errors are detected.

Reference no: EM13968794

Questions Cloud

Discuss strengths and weaknesses of your analogy. : Provide a list that explains how each item or action in your analogy corresponds to an item or action in the assigned topic.
Decision tree and the optimal decision : The company may test the potential of the rural market for a cost of $25,000. The test has a 90% reliability of correctly detecting the state of nature. Construct the decision tree and determine the optimal decision.
Assignment related to the quality of management : First assignment is requesting to develop an Abstract which must be submitted by end of this week to the tutor. However, the second assignment can be differed till submission within two weeks.
Probability of correctly detecting the state of nature : Testing the new idea on actual ?ights would cost $60,000, and the results would have a 0.85 probability of correctly detecting the state of nature. What should Swiss do?
Develop and test html document that has checkboxes for apple : Develop and test an HTML Document that has checkboxes for apple (59 cents each), oranges (49 cents each), and Banana (39 cents each), along with a submit button.
Evaluation of the project success : Soames could pay a movie industry expert $5,000 for an evaluation of the project's success. He believes that the expert's conclusions are true 90% of the time. What should Soames do?
What challenges consultants face : Identify three possible dissertation research topics related to the subject of the course. Discuss some of the problems or opportunities that each of these three studies addresses.
Handling additional information in a decision problem : 1. Explain why Bayes' theorem is necessary for handling additional information in a decision problem. 2. Explain the meaning of the term predictive probability.
Buyers and suppliers of commodities : Commodity futures provide an opportunity for buyers and suppliers of commodities such as wheat to arrange in advance sales of a commodity, with deliv- ery and payment taking place at a speci?ed time in the future.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd