Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14174

Removing event handler

Date 2012-05-27 20:04 +1000
From Andrew Poulos <ap_prog@hotmail.com>
Newsgroups comp.lang.javascript
Subject Removing event handler
Message-ID <RYCdnSEKaLK3YVzSnZ2dnUVZ_v2dnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


If I have an onclick event handler I can "remove" it anywhere with

elem.onclick = null;

But if the handler is added using addEventListener which is in this sort 
of code

var a = function(o) {
   var transformer = function() {
     // do stuff
   }

   o.elem.addEventListene("click", transformer, false);

}(obj);

How can I remove the event handler outside of 'a'?

Andrew Poulos

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Removing event handler Andrew Poulos <ap_prog@hotmail.com> - 2012-05-27 20:04 +1000
  Re: Removing event handler Martin Honnen <mahotrash@yahoo.de> - 2012-05-27 12:21 +0200

csiph-web