<!DOCTYPE html>
<html>
<body>
<div id="div_id">
<button onclick="remove_event()">Click To Remove Event Listener</button>
</div>
<p id="p_id"></p>
<script>
document.getElementById("div_id").addEventListener("mousemove", f);
function f() {
document.getElementById("p_id").innerHTML = Math.random();
}
function remove_event() {
document.getElementById("div_id").removeEventListener("mousemove", f);
}
</script>
</body>
</html>
<!--
run:
0.7068933414417972
-->