There is prototype js function:
Event.observe(element, eventName, handler)
here the element means element’s ID.
Is it possible to put here element’s class?
I got this element from third party with class attribute only.
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.
$$can retrieve elements by css selector, including by class via the period notation.:To answer your question,
Event.observeis the “static” version ofobserve(for all intents and purposes). As a convenience Prototype automagically makes.observeavailable off of all DOM elements (fetched with either$or$$):Examples: