Dynamically generate menus using DOM factory methods

Assignment Help Basic Computer Science
Reference no: EM133234685

[{"animal_id":4,"animal_type":"dog","animal_breeds":[{"breed_id":1,"breed_name":"Beagle"},{"breed_id":2,"breed_name":"Poodle"},

"breed_id":3,"breed_name":"Hound"},{"breed_id":4,"breed_name":"Collie"}]},{"animal_id":7,"animal_type":"cat","animal_breeds"

[{"breed_id":1,"breed_name":"Tabby"},{"breed_id":2,"breed_name":"Calico"},{"breed_id":3,"breed_name":"Persian"}]}

{"animal_id":11,"animal_type":"bat","animal_breeds":[{"breed_id":1,"breed_name":"Hoary"},{"breed_id":2,"breed_name":"Egyptian Fruit"},{"breed_id":3,"breed_name":"Spotted"},{"breed_id":4,"breed_name":"Leaf-nosed"}]}

{"animal_id":17,"animal_type":"rat","animal_breeds":[{"breed_id":1,"breed_name":"Sewer"},{"breed_id":2,"breed_name":"Bilge"}

{"breed_id":3,"breed_name":"Dirty"}]}]';

The animal types should be listed in a dropdown menu when the page first loads. Use javascript only.

1. Dynamically generate menus using DOM factory methods. The first menu is generated when the page loads, the second one when choices are made from the first.

2. The menu should have an onchange event handler that causes a second menu for the breeds of the selected animal to suddenly appear (Conjured out of thin air!). Use DOM factory methods to create the breeds menu on-the-fly.

3. Make sure that re-choosing the dummy item in the first menu removes the breeds menu, and that choosing a different animal will re-create the second menu.

4. You must use the Animal IDs as the hidden values of the first menu's options. In a real application, this data would come from a database query, and the IDs would be primary keys from the database records.

5. When a choice is made from the first menu, you must console.log() the chosen menu option so I can see it - both the hidden value AND the text of the chosen option. Making sure you are correctly identifying the first menu choice is the best way to get started. Then all you need to worry about is using that to build the 2nd menu.

Reference no: EM133234685

Questions Cloud

Python-write function named strongly : (Python) Write a function named strongly() that converts its argument to a numeric value. If strongly() is sent any of the strings "Strongly
Digits and uppercase characters in given string : Write an assembly program that counts the number of digits and uppercase characters in the given string.
Explain two basic structures of javascript object notation : Identify and explain 2 main areas/fields concerned with internet governance. Explain the two basic structures of JavaScript Object Notation (JSON).
Describe shmat system function : Describe the shmat system function, including what a shared memory file is, how a process is generated, and why such a call is necessary.
Dynamically generate menus using DOM factory methods : Dynamically generate menus using DOM factory methods. Make sure that re-choosing the dummy item in the first menu removes the breeds menu,
Deployment mode-integration and legal perspectives : Discuss on how the selected Deployment Model(s) will meet your business requirements from the integration and legal perspectives.
Strongly connected component : A strongly connected component (SCC) of a directed graph is a maximal strongly connected subgraph.
Compute these statistics on numeric variable : Compute these statistics on a numeric variable by grouping on a categorical variable.
Relies on asymmetric encryption : In a client-server program that relies on Asymmetric encryption: RSA, All messages are encrypted except request_key and its response

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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