What is the difference between javascript obj.onclick and prototype’s Event.observe(obj, ‘click’,fn) ?
What is the difference between javascript obj.onclick and prototype’s Event.observe(obj, ‘click’,fn) ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
obj.onclick is a DOM0 specification and probably has nothing to do with Prototype’s
Event.observewhich is a wrapper around the DOM methodsdocument.addEventListener(ordocument.attacheventfor IE), equivalent to jQuery’s$(element).bind('click', fn);If you want to know more about the differences between DOM0-2 checkout this page.