Lab 7: More JavaScript





Exercise I

    Create the following website. TIP: Store and retrieve key/value pairs using HTML5 localStorage.





Exercise II

    Write the Javascript code to add a gradient to an HTML gradient div element with the id "gradient". The gradient is formed by creating 20 shaded boxes, starting with the bigger boxes and moving forwards to the smallest box. The largest box starts at 400x400px and decrements in size by 20px each level. The color of the outermost box is rgb(255, 255, 255) and decrements by 10 values for each color (e.g. the second largest box would be rgb(245, 245, 245)). After your Javascript code runs, the appearance and behavior should be the following:





Exercise III

    Write Javascript code to create a selection box below with the following five names: Charlie, Odie, Nelly, Pooky, and Jony. When the selected name in the box changes, a greeting containing the word "hello" followed by the person's name (in lowercase) with the first letter repeated, should be displayed.





Exercise IV

    Create a website that allows users to enter a sentence. Provide a button to translate the sentence into pig latin and display it on the screen.




Exercise V

Create page with the dropdown functionality shown below.