Created
February 25, 2015 00:19
-
-
Save ledsun/da7ae45733279d628871 to your computer and use it in GitHub Desktop.
Sample of https://github.com/ftlabs/ftdomdelegate
This file contains 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
<script src="http://wzrd.in/standalone/dom-delegate@latest"></script> | |
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
domDelegate(document.body).on('click', 'button', handleButtonClicks) | |
document.body.innerHTML = '<button>buton</button>' | |
}) | |
function handleButtonClicks(event) { | |
console.log('click', event) | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment