title: jQuery .data() not working with $(this)
body: <p>I want to store the initial data of my <code>input</code> fields (to be able to check against these initial values later on). Therefore, I use the following code snippet when my page loads:</p>
  
  <pre><code>$(document).ready(function () {
      $('input').data('initial-value', $(this).val() )
  }
  </code></pre>
  
  <p>The problem is that the above does not store the initial value of the <code>input</code> field in a data attribute <code>initial-value</code>. The attribute is not created.</p>
  
  <p>The following does work:</p>
  
  <pre><code>$('input').data('initial-value', 'whatever value' )
  </code></pre>
  
  <p>Can't I use the jQuery <code>$(this)</code> operator inside the <code>.data()</code> method? If so, what else could I do?</p>