eBay Interview Question

how would you attach an event to an object

Interview Answers

Anonymous

Sep 26, 2012

I said using bind. He wanted another way

1

Anonymous

Dec 4, 2014

You also use .addEventListener or onEvent (ex: oncl1ck, onm0useover etc)

1

Anonymous

Sep 6, 2015

Using jQuery and the .on() method with a click event listener: $('body').on('click', '#objectId', function() { // this says within the body, upon a click event on the ID objectId, run this code... });