Assignment 11

advertisement

CSCE 102 L

AB

11 —E

VENT HANDLERS

General information

 You must work from your x drive while you are in the lab (not your laptop) and copy your work to your USB memory stick at the end of lab.

 Do not put your files on anyone else’s flash drive or allow anyone to put their files on yours.

 Read the entire assignment before you start.

 Always bring your textbook and lecture notes to lab.

 Use clean indentation so your code will be easy for you to read and also easy for your instructor to read.

 Include the closing tags when you enter the opening tags so you will not forget them.

 Always maintain backup copies of your work. You must work from your x drive while you are in the lab (not your laptop) and copy your work to your flash drive at the end of lab.

 Never share your password or memory stick with anyone. Maintain the standards of academic honesty discussed in lecture and in previous labs. The work you turn in must be your work.

Topic: — More JavaScript

1.

Create a simple web page that contains at least two of each of the following elements h1, h2, h3, div, paragraph, em, and strong. Fill the elements using random text from Lorem Ipsum at http://www.lipsum.com/ . Name your file as lab11 xx .html, where xx is the initials of your name.

2.

Use an internal CSS to apply style to all of these elements; do something neat.

3.

Use the onclick event handler in the first h1 to change the style of that h1 and also change the style of the first paragraph. (The attribute value of the onclick event handler will contain two JavaScript statements. There can only be one onclick in a tag.)

4.

Use onmouseover to change two styles in the first div element. Use onmouseout to set the styles back to what they were set to by the CSS.

5.

When the first paragraph is moused over change two styles of the second paragraph.

6.

When you mouse over a strong element have it increase in size and change the background color of that element.

7.

When you click on the first h2 element have a prompt box open that asks for a color. Then turn the background of the h2 to the color that was entered.

8.

When you click on the second h2 element have a prompt box open that asks for a color. Then turn the background color of the page to the color that was entered.

9.

Change some styles when you mouse out of the first h3.

Update your All_Index page.

1.

Include links in the list to lab 11 file.

2.

Be certain that your image is displayed at the top of the page.

Download