ga-wdi-exercises / project1

[project] GA- Project 1
3 stars 75 forks source link

issue with an addEventListener #219

Closed khenry10 closed 8 years ago

khenry10 commented 8 years ago

I tried to use an "addEventListener" to call a function to see if the user has found any matches, but the function only gets called when I execute in the js console. I expected 'findMatches() to execute on mouseover. Nothing happened instead. My repo link is https://github.com/khenry10/project1/tree/gh-pages and my question is about lines _32__.

RobertAKARobin commented 8 years ago

Event listeners can take one of two formats:

element.addEventListener("click", function(){
  alert("Hi!");
});
element.addEventListener("click", sayHi);
function sayHi(){
  alert("Hi!");
}

Hint: Your answer is in the punctuation.

khenry10 commented 8 years ago

Doh - thanks Robin! closing this out :D