Git Product home page Git Product logo

dom_intro_exercise's Introduction

DOM_Intro_Exercise

Practice manipulating the DOM!

Part One:

In a separate JS file:

When the page loads:

  1. Change the greeting from "Hello, There!" to "Hello, World!".

  2. Set the background color of each <li> to yellow.

  3. Create an image tag, set its src attribute to http://49.media.tumblr.com/tumblr_m6qt1rjPSz1rxjzkho1_500.gif, and append the to the #greeting div.

  4. Create and add a ul element to the end of the body with a class of "todo-items"

  5. Go through the array ['make coffee','eat donut','change diapers','drive to work'] and create an li element for each item e.g. <li>make coffee</li>

  6. Add each newly created li element to your ul of class "todo-items"

Part Two:

Afterwards:

  1. Add the class of selected to an <li> when it is clicked. Remove it from any other lis as well.

  2. Change the image to be the most recently clicked food item.

  3. When the gray div is moused over, it's removed from the DOM.

  4. When the orange div is moused over, its width doubles. When the mouse moves out of the div, it returns to its original size.

  5. When the reset button is clicked - remove the selected class from each <li> and change the image to panic.jpeg.

  6. When the 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 key is pressed, the page alerts the message "I HATE NUMBERZZZ!"

BONUS: If someone types the Konami Code, the page alerts "YOU ARE AN EVENT HANDLER GURUUUUUUUUU!"

dom_intro_exercise's People

Contributors

mmmaaatttttt avatar zubaird avatar brettlyons avatar colt avatar elie avatar macwayne avatar mjhea0 avatar craftninja avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.