Question

Without using functions: 1. Include a heading with your name section and today’s date. 2. Insert...

Without using functions:

1. Include a heading with your name section and today’s date.

2. Insert an image of a blue flower. All images are to be saved in a folder called Lab8_Images.

3. Put the image in a div and using a local style (in-line) in the div to center the image.

Hint: use text-align

4. Insert an h1, h2, h3, h4 and a short paragraph. You decide the content.

5. Write the JavaScript code so that when you to mouse over the blue flower, the h1 changes to read: A Beautiful Blue Flower. Hint: use getElementById (the id goes here).innerHTML to change text.

6. When you click on the h2,

  1. Set the background color of the webpage to palegreen
  2. Chang the font size of the h2 to 56pt
  3. Chang the font size of the h1 to 64pt
  4. Change the text color of the h1 to red

7. When you mouse over the paragraph use JavaScript to make 3 things happen.

Insert an HTML comment to tell what happens,

8. When you click on the h4 change the alignment of the div to put the image on the right edge of the window.

9.Make something neat happen when you click on the h3.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE:

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Document</title>

    <style></style>

  </head>

  <body>

    <h1>Your Name Date:3/30/2020</h1>

    <div style="text-align: center;">

      <img src="/Lab8_Images/1.jpg" width="100px" id="image" />

    </div>

    <h1 id="header-h1">

      Abilities forfeited situation extremely my to he resembled. Old had

      conviction discretion understood put principles you. Match means keeps

      round one her quick.

    </h1>

    <h2 id="header-h2">

      She forming two comfort invited. Yet she income effect edward. Entire

      desire way design few. Mrs sentiments led solicitude estimating friendship

      fat. Meant those event is weeks state it to or. Boy but has folly charm

      there its. Its fact ten spot drew.

    </h2>

    <h3 id="header-h3">

      She forming two comfort invited. Yet she income effect edward. Entire

      desire way design few. Mrs sentiments led solicitude estimating friendship

      fat. Meant those event is weeks state it to or. Boy but has folly charm

      there its. Its fact ten spot drew.

    </h3>

    <h4 id="header-h4">

      She forming two comfort invited. Yet she income effect edward. Entire

      desire way design few. Mrs sentiments led solicitude estimating friendship

      fat. Meant those event is weeks state it to or. Boy but has folly charm

      there its. Its fact ten spot drew.

    </h4>

    <b>Paragraph</b>

    <!-- when hovered the paragraph get italics -->

    <!-- when hovered change backgroud color of text -->

    <!-- add black border to image -->

    <p id="paragraph">

      design few. Mrs sentiments led solicitude estimating friendship fat. Meant

      those event is weeks state it to or. Boy but has folly charm there its.

      Its fact

    </p>

  </body>

  <script>

    const image = document.getElementById("image");

    const header1 = document.getElementById("header-h1");

    const header2 = document.getElementById("header-h2");

    const header3 = document.getElementById("header-h3");

    const header4 = document.getElementById("header-h4");

    const paragraph = document.getElementById("paragraph");

    image.addEventListener("mouseover", e => {

      header1.innerHTML = "A Beautiful Blue Flower.";

    });

    header2.addEventListener("click", e => {

      document.body.style.backgroundColor = "palegreen";

      header2.style.fontSize = "52px";

      header1.style.fontSize = "64px";

      header1.style.color = "red";

    });

    header4.addEventListener("click", e => {

      document.getElementById("image").style.float = "right";

    });

    header3.addEventListener("click", e => {

      header3.style.color = "blue";

      header3.style.textDecoration = "underline";

    });

    paragraph.addEventListener("mouseover", e => {

      paragraph.style.fontStyle = "italic";

      paragraph.style.backgroundColor = "yellow";

      image.style.border = "4px solid black";

    });

  </script>

</html>

OUTPUT:

Please upvote if you like my answer and comment below if you have any queries or need any further explanation.

Add a comment
Know the answer?
Add Answer to:
Without using functions: 1. Include a heading with your name section and today’s date. 2. Insert...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT