Skip to content

Instantly share code, notes, and snippets.

@zhuzhuaicoding
Created October 19, 2012 11:17
Show Gist options
  • Select an option

  • Save zhuzhuaicoding/3917668 to your computer and use it in GitHub Desktop.

Select an option

Save zhuzhuaicoding/3917668 to your computer and use it in GitHub Desktop.
bind mulitiple click events,can all exec.
http://jsfiddle.net/UumUP/2913/
// Function to change the content of t2
function modifyText() {
var t2 = document.getElementById("t2");
t2.firstChild.nodeValue = "three";
}
// add event listener to t
var el = document.getElementById("t");
el.addEventListener("click", modifyText, false);
el.addEventListener('click', function(){console.log('12313')}, false)
绑定到el上的click事件都可以执行
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment