title: Cannot add click events to list items
body: <p>This is my first foray into using Javascript with HTML. I'm trying to add click events to the list items in an ordered list, but something about the way I'm doing it isn't working. Can somebody shed some light on this for me? </p>
  
  <p>I create a function in my <code>head</code> that should delegate all click events on the list items of a specified list to a given function, and in that given function I try to raise a simple alert with the text of the list item. Eventually I want to do more, but I'm just trying to get the simple click events to work first.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;script type="text/javascript"&gt;
        // Attach an event handler to the 'topfriends' list to handle click events.
        function attachEventHandlerToList() {
            document.getElementById("#top4list").delegate("li", "click", function(clickEvent) {
                alert(this.innerHTML());
            });
          }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;div id="topfriends"&gt;
          &lt;h3&gt;Top 4 Most Friendable Friends&lt;/h3&gt;
          &lt;ol id="top4list" onload="attachEventHandlerToList()"&gt;
              &lt;li&gt;Brady&lt;/li&gt;
              &lt;li&gt;Graham&lt;/li&gt;
              &lt;li&gt;Josh&lt;/li&gt;
              &lt;li&gt;Sean&lt;/li&gt;
          &lt;/ol&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>