title: Can't get ID of 'this' variable
body: <p>So I have a jquery event that is inside of <code>$(document).ready(function() { //.....// });</code>. It has the following code:</p>
  
  <pre><code>$('.puzzle_cells').keyup(function(event) {
  
  });
  </code></pre>
  
  <p>The next thing I need to do is get the ID of the <code>&lt;input&gt;</code> element with a class <code>'puzzle_cells'</code> (BTW every <code>&lt;input&gt;</code> with a class of <code>'puzzle_cells'</code> has an ID). Naturally I would use the <code>this</code> variable, but I can't figure out how to get it into a jquery <code>.attr('id')</code> function.</p>
  
  <p>To make sure it's clear, I need the id of the '.puzzle_cells' that was typed in.</p>
  
  <p><strong>UPDATE:</strong> Sorry everyone, actually it wasn't the <code>&lt;input&gt;</code>s that had IDs but the parent <code>&lt;td&gt;</code> that did for each one. So, I switched my code from <code>$(this).attr('id');</code>to <code>$(this).parent('td').attr('id');</code> and it works now. I can't really try <code>this.id</code> because of the parent thing, but I'm sure it works.</p>