Prototype 1.6:

I’ve recently been using Prototype 1.6 and had a need for a clone. The following code appears to emulate mouse events well (form submits [and maybe more…] do not work in IE): = function(s, e, f) {
    Event.observe(document, e, function(event) {
        if (Element.match(, s)) {
            if (!(, event))) {

To use this run something like the following:'div#doesnt_exist_yet a.button', 'click', function() {
    // run this when the button is clicked

Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.