This is usually done with Event#findElement
:
document.observe('click', function(e, el) {
if (el = e.findElement('.foo')) {
// there's your `el`
// might want to stop event at this point - e.stop()
}
});
More Related Contents:
- jQuery Event Keypress: Which key was pressed?
- How to capture the browser window close event?
- Definitive way to trigger keypress events with jQuery
- How to order events bound with jQuery
- Firing event on DOM attribute change
- Can I call jQuery’s click() to follow an link if I haven’t bound an event handler to it with bind or click already?
- How to trigger the window resize event in JavaScript?
- How do you log all events fired by an element in jQuery?
- Trigger an event with Prototype
- How to unbind a listener that is calling event.preventDefault() (using jQuery)?
- Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser
- Jquery: change event to input file on IE
- How can I listen for a click-and-hold in jQuery?
- Preventing click event with jQuery drag and drop
- jQuery: How to get the event object in an event handler function without passing it as an argument?
- Attach an event in a child iframe to a handler in the parent window
- Javascript with jQuery: Click and double click on same element, different effect, one disables the other
- jQuery: Unbind event handlers to bind them again later
- jQuery event that triggers after CSS is loaded?
- Performance difference between jQuery’s .live(‘click’, fn) and .click(fn)
- Get the clicked object that triggered jquery blur() event [duplicate]
- Drop event not firing in chrome
- Prevent onclick action with jQuery
- Capture event onclose browser
- List all javascript events wired up on a page using jquery
- jQuery: How to listen for DOM changes?
- Is there an equivalent to e.PageX position for ‘touchstart’ event as there is for click event?
- Fire oninput event with jQuery
- jquery keypress event object keyCode for firefox problem?
- How to capture browser close event?