Want a Free Job Posting?

Buy a job posting today and the second one is on us. For a limited time only. Act Now.

Interview Question

Interview San Jose, CA

how would you attach an event to an object


Interview Answer

3 Answers


I said using bind. He wanted another way

Interview Candidate on Sep 25, 2012

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

Anonymous on Dec 4, 2014

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.