nl_tokens: Bind element event type to fn .
pl_tokens: function handle ( top , element , type , fn , capture ) { if ( ! element || ! ( typeof element === 'string' || typeof element . length === 'number' || 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 ( <mask> ) ) ; 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 ) ) ; } if ( typeof element === 'string' ) { return handleElement ( top , type , function ( body , e ) { var target = findMatch ( body , e . target , element ) ; e . delegateTarget = target ; if ( target ) fn ( target , e ) ; } , capture ) ; } else if ( typeof element . addEventListener !== 'function' && typeof element . length === 'number' ) { return handleElements ( element , type , fn , capture ) ; } else { return handleElement ( element , type , fn , capture ) ; } }