Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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

 

    5.1.html

   

   

 

 

   

Favorite Color

   

     

       

                       value = "10"   

                       onclick = "colorChoice(10)" />

       Color red

       

       

                       value = "20"

                       onclick = "colorChoice(20)" />

        Color blue

       

       

                       value = "30"

                       onclick = "colorChoice(30)" />      

      Color green

       

       

                       value = "40"

                       onclick = "colorChoice(40)" />

       Color yellow

       

       

                       value = "50"

                       onclick = "colorChoice(50)" />

        Color orange

       

   

 

(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.

Java, Programming

  • Category:- Java
  • Reference No.:- M91643739
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Java

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As