Cycymomo
8/1/2013 - 11:46 AM

bindEvent.js

bindEvent.js

var bindEvent = function( element, type, eventHandler ) {
  if ( element.addEventListener ) {
    element.addEventListener( type, eventHandler, false );
  } else if ( element.attachEvent ) {
    element.attachEvent( "on" + type, eventHandler );    
  }
};
 
bindEvent(document.getElementById('mon_element'), 'change', function () {
  alert('je change !');
});