Pastetool - addEvent

URL: , Paste another

function addEvent(elm, evType, fn, useCapture)
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
}

Download code

This javascript code was pasted on September 25, 2009




Protected with advance Anti-SPAM techniques :)
Coded and designed by Fedmich
Follow us on Twitter