removeeventlistener

Java
var someEventHander=function(event){
	console.log("do something");
}

//add listener
document.getElementById("someid").addEventListener('click',someEventHander);

//remove listener 
document.getElementById("someid").removeEventListener('click',someEventHander);//                             type         function
element.removeEventListener("mousedown", handleMouseDown)
// full type list available here: https://developer.mozilla.org/en-US/docs/Web/Eventselement.removeEventListener(event, listener, useCapture)
Source

Also in Java: