Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 754 Bytes

ex_39.md

File metadata and controls

30 lines (27 loc) · 754 Bytes

Exercise 39

  • Create the following folder/file structure:
/ex_39
  |-- index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Events</title>
  </head>
  <body>
    <div></div>
    <button id="firstButton">Click Me!!</button>
    <button id="secondButton">Remove event listener</button>
    <a href="https://google.com">Link with JavaScript handler</a>
  </body>
</html>

index.html

  • Create a basic HTML document
  • Create a script tag on the document head element
  • Select the firstButton id element and add a ondblclick event handler
  • Define a counter numberic variable and set the value to 0
  • Increment the counter variable When the user double clicks the firstButton element
  • Show the counter value using the div element