Skip to content

Instantly share code, notes, and snippets.

@vladocar
Created May 22, 2011 23:27
Show Gist options
  • Save vladocar/985999 to your computer and use it in GitHub Desktop.
Save vladocar/985999 to your computer and use it in GitHub Desktop.
Event Delegate 1
document.getElementById("main").addEventListener("click", function (e) {
if ($("ul>li>a,#paragraph>a").indexOf(e.target) >= 0) {
console.log("Clicked!");
alert("Clicked!");
}
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment