Created
October 19, 2012 11:17
-
-
Save zhuzhuaicoding/3917668 to your computer and use it in GitHub Desktop.
bind mulitiple click events,can all exec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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