Use next and prev() in jquery
<pre><code>&lt;label for="a1"&gt;First:&lt;/label&gt;
&lt;input id="a1" class="first" type="text" name="a1" value="123"&gt;
&lt;label for="b1"&gt;Second:&lt;/label&gt;
&lt;input id="b1" class="second" type="text" name="b1"&gt; &lt;br /&gt;
&lt;label for="a2"&gt;First:&lt;/label&gt;
&lt;input id="a2" class="first" type="text" name="a2"value="3424"&gt;
&lt;label for="b2"&gt;Second:&lt;/label&gt;
&lt;input id="b2" class="second" type="text" name="b2"&gt; &lt;br /&gt;
&lt;label for="a3"&gt;First:&lt;/label&gt;
&lt;input id="a3" class="first" type="text" name="a3"value="1235"&gt;
&lt;label for="b3"&gt;Second:&lt;/label&gt;
&lt;input id="b3" class="second" type="text" name="b3"&gt; &lt;br /&gt;

$('.second').click(function(){
   var get_first = // ???
   $(this).val(get_first);
})
</code></pre>

<p>i would like for example - if i click on input b3 then in this value now is value from a3. how can i make it with next and prev in one class?</p>

<p><a href="http://jsfiddle.net/Bgkrz/" rel="nofollow">http://jsfiddle.net/Bgkrz/</a></p>
