title: how to define variable in jquery
body: <p>I would like to know how to declare a variable in jQuery</p>
  
  <p>The code I am currently using is</p>
  
  <pre><code>$.name = 'anirudha';
  alert($.name);
  </code></pre>
  
  <p>That code works fine, but if I write it as</p>
  
  <pre><code>$.name = document.myForm.txtname.value;
  alert($.name);
  </code></pre>
  
  <p>Then my code does not work. </p>