title: Replacing document.getElementById with jquery function?
body: <p>I have this code snippet:</p>
  
  <pre><code>$('#selector1,#selector2').change(function(){
      checkDate(document.getElementById($(this).attr("id")));
  });
  </code></pre>
  
  <p>The above works fine, but I want to use jQuery's <code>$</code> instead of <code>document.getElementById</code>. So, I tried this but it gives me a javascript error: <code>TypeError: valueToTest is undefined</code></p>
  
  <pre><code>$('#selector1,#selector2').change(function(){
      checkDate($("#" + $(this).attr("id")));
  });
  </code></pre>