If I register an object's method as an event handler, I can't remove it. Am I missing something obvious, or can't it be done?
function Test() {
document.body.addEventListener( 'click', this.handler.bind( this ), false );
}
Test.prototype.handler = function() {
document.body.innerHTML += '.';
document.body.removeEventListener( 'click', this.handler.bind( this ), false );
};
new Test();
body {
border: 1px solid black;
width: 100px;
height: 100px;
font-size: 30px;
}