Skip to content

Instantly share code, notes, and snippets.

@HAKASHUN HAKASHUN/app.js
Created Oct 28, 2013

Embed
What would you like to do?
addEventListenerで無名関数をセットした際に、無名関数内でそのイベントをremoveEventListenerする
var btnEl = document.getElementById('btn');
btnEl.addEventListener('click', function(e) {
var target = e.currentTarget;
//btnElに指定したイベントをremove
target.removeEventListener('click', arguments.callee, false);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.