title: jquery - each / click function not working
body: <p><strong>EDIT: this works, but not sure why?</strong></p>
  
  <pre><code>  $('button').each(function() {
      $(this).bind(
          "click",
          function() {
              alert($(this).val());
          });
    });
  </code></pre>
  
  <p>I'm not sure why this isn't working... Right now, I'm just trying to output an alert with the button value, but it's not working on my page.  I don't get any console errors in Firebug and can't see anything that would prevent it from working.  </p>
  
  <p>My HTML looks like this:</p>
  
  <pre><code>&lt;table id="addressbooktable"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Action&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;7892870&lt;/td&gt;
          &lt;td&gt;&lt;button id="button-20" class="custom-action" value="XY89" name="info"&gt;Click&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td&gt;9382098&lt;/td&gt;
          &lt;td&gt;&lt;button id="button-21" class="custom-action" value="XY544" name="info"&gt;Click&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td&gt;3493900&lt;/td&gt;
          &lt;td&gt;&lt;button id="button-22" class="custom-action" value="XY231" name="info"&gt;Click&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And the code looks like this:</p>
  
  <pre><code>  $('button').each(function() {
      $(this).click(function() {
        alert($(this).val());
      }
    });
  </code></pre>
  
  <p>But, clicking on it does nothing at all?  Am I using it incorrectly?</p>