PrepAway - Latest Free Exam Questions & Answers

Which lines of code should you use?

HOTSPOT
You are developing an airline reservation website by using HTML5 and JavaScript. A page on the site allows users to enter departure and destination airport information and search for tickets.
You have the following requirements:
Users must be able to save information in the application about their favorite destination airport.
The airport information must be displayed in the destination text box whenever the user returns to the page.
You need to develop the site to meet the requirements.
Which lines of code should you use? (To answer, select the appropriate options from the drop-down lists in the answer area.)

A.

Explanation:

3 Comments on “Which lines of code should you use?

  1. carol says:

    So the explanation will be that in the first box you are retrieving the ALREADY stored value by means of a key.value pair reference and assigning it to the “dest” variable.that is the show Destination function. Next which is actually the storing part you create an instance of local storage with a key which is localStorage.destination and assign the value retrieved from the user input to the key, which is the dest variable. dont get confused here they have first shown the show method before the store method , this is where you will make the mistake.




    1



    0

Leave a Reply