Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  <br/>
  
  <div id='d1' > Hi i am div1</div>
  <br/>
  
  <div id='d1' > Hi i am div1</div>
  <br/>
  
  <div id='d1' > Hi i am div1</div>
  
  
</body>
</html>
 
window.onload = function() {
function listen() {
     alert( this);
  }
var evtListener = listen.bind('hello');
  
  
document.getElementById('b1').addEventListener("click", evtListener);
 
 function removeNaive() {
document.getElementById('b1').removeEventListener("click", listen.bind('hello'));   
  }
  
    function removeStored() {
document.getElementById('b1').removeEventListener("click",evtListener);
   
  }
document.getElementById('b2').onclick=removeNaive;
  
document.getElementById('b3').onclick=removeStored;
  
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers