nl_tokens: Bind element event type to fn .
pl_tokens: function handleElement ( element , type , fn , capture ) { if ( ! <mask> || typeof element . addEventListener !== 'function' ) throw new TypeError ( 'Cannot bind event ' + inspect ( type ) + ' to ' + inspect ( element ) ) ; if ( typeof type !== 'string' ) throw new TypeError ( 'Event type must be a string, e.g. "click", not ' + inspect ( type ) ) ; if ( typeof fn !== 'function' ) throw new TypeError ( '`fn` (the function to call when the event is triggered) must be a function, not ' + inspect ( fn ) ) ; if ( capture !== undefined && capture !== false && capture !== true ) { throw new TypeError ( '`capture` must be `undefined` (defaults to `false`), `false` or `true`, not ' + inspect ( capture ) ) ; } function onEvent ( e ) { e . delegateTarget = element ; return fn ( element , e ) ; } element . addEventListener ( type , onEvent , capture || false ) ; return element . removeEventListener . bind ( element , type , onEvent , capture || false ) ; }