return value from jquery function
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4982983/jquery-ajax-return-value">jQuery ajax return value</a>  </p>
</blockquote>



<p>I have this jQuery script:</p>

<pre><code>$('#headerSubmit').click(function() {
    var source = $('#header').attr('value');
});
</code></pre>

<p>that gets the <code>value</code> attribute of the element and stores it in the <code>source</code> variable. </p>

<p>How do I return the <code>source</code> variable to use in the rest of the script?</p>

<p>Thanks.</p>
