week 7- 28 Days Later….

This has been a hell of a few weeks. no movie theaters, can’t go outside and when you do go outside it looks like all life has been wiped out

but at least we have coding

directory

for 14 advanced dom manipulation

for Problem set

Blogging Questions

Describe what the two arguments of the addEventListener method are and how they work. Give four examples of the first argument and give examples of using an anonymous function vs. a declared function for the second argument. Use the code-insert tool for your examples.

Its a method attaches an event handler to an element without overwriting existing event handlers.  You can add many event handlers to one element two “click” events for example


var x = document.getElementById("myBtn");
x.addEventListener("mouseover", myFunction);
x.addEventListener("click", mySecondFunction);
x.addEventListener("mouseout", myThirdFunction);

function myFunction() {
  document.getElementById("demo").innerHTML += "Moused over!<br>";
}

function mySecondFunction() {
  document.getElementById("demo").innerHTML += "Clicked!<br>";
}

function myThirdFunction() {
  document.getElementById("demo").innerHTML += "Moused out!<br>";
}

Leave a comment

Your email address will not be published. Required fields are marked *

css.php