<p>Jquery has a great language construct that looks like this:</p>

<pre><code>$(document).ready(function() {
    $("a").click(function() {
        alert("Hello world!");
    });
});
</code></pre>

<p>As you might guess this, once the document has loaded, binds a custom function to the onClick event of all <strong><em>a</em></strong> tags.</p>

<p>The question is, how can I achieve this same kind of behavior in Prototype?</p>

```
```
Event.observe(window, 'load', function() { 
     Event.observe(element, 'click', function() { 
         alert("Hello World!");
     });
});
```
```
Of course you need to "select" the elements first in Prototype.