Passing parameters in jQuery
<p>What i have is working, so I'm just asking if there's a more elegant way to do this.  I have:</p>

<pre><code>&lt;form method="post" action="15Action.cfm"&gt;
&lt;p&gt;&lt;input id="A" name="A1"&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="B" name="B1"&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="C" name="C1"&gt;&lt;/p&gt;
&lt;input name="Submit" type="submit" value="submit"&gt;
&lt;/form&gt;
</code></pre>

<p>If the changes either A or B, then concatenate the two fields together and place them into C.
What I have is:</p>

<pre><code>function doit(A,B) {
   return A+B;
};
$(function() {
   var A = $('#A');
   var B = $('#B');
  $('#A, #B').change(function() {
  $('#C').val(doit(A.val(),B.val()));
  });
});
</code></pre>

<p>I wonder if I should write</p>

<pre><code>$('#C').val(doit(A,B))
</code></pre>

<p>instead, or is it acceptable to pass A.val(), B.val()?</p>
