function foo() { // do things, then removeEventListener('click', foo); } addEventListener('click', foo);