Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- <style>
- div {
- height: 150px;
- width: 550px;
- display: inline-block;
- background-color: lavender;
- text-align: center;
- }
- p {
- font-size: 3rem;
- width: 75%;
- margin: 0 auto;
- border: 1px solid black;
- }
- div, p {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%,-50%);
- border-radius: 10px;
- }
- </style>
- <script>
- //LABEL ALL CONSOLE LOGS!!!
- //within these script tags:
- //declare a function called "handleClick", it should have one parameter named "element"
- //when this function is called from the HTML, it should console log the global event variable
- //it should also console log the "element" parameter
- //finally, the "handleClick" should call an alert with a string that congratulates you on your click success
- </script>
- </head>
- <!--place an onload event on that body element that lets you know the body has loaded-->
- <body>
- <!--place an onclick event on the div which calls the handleClick function and pass in "this" as an argument-->
- <div>
- <p>Click on Me!!!</p>
- </div>
- </body>
- </html>
- <!--For a bonus challenge, incorporate more Dom events into your HTML, add elements, add functions to your
- script tags, have fun! -->
Add Comment
Please, Sign In to add comment