I need to bind event listener to all dynamicaly created elements by given css selector.
In jQuery, that would be
$(\".foo\").live(\"click\", function
This is usually done with Event#findElement:
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() } });