eBay Interview Question: how would you attach an event... | Glassdoor

Interview Question

Front End Software Engineer Interview San Jose, CA

how would you attach an event to an object

Answer

Interview Answer

3 Answers

1

I said using bind. He wanted another way

Interview Candidate on Sep 25, 2012
0

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

Anonymous on Dec 4, 2014
0

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...
});

James Coury on Sep 6, 2015

Add Answers or Comments

To comment on this, Sign In or Sign Up.