jQuery select by two name roots and perform one of two function depending on which root was selected
<p>I'm trying to get this code to work in jQuery and I'm trying to make sure that for each iteration of each root element, its alternate root element for that same iteration doesn't contain anything.  Otherwise it sets the .val("") property to an empty string.  Looking for a simple solution if possible using search, find, or swap.</p>

<p>Each matching number is on the same row level and the same iteration count.</p>

<p>I have two input types of input text elements with two different root names like so:</p>

<p>1st Root is "<strong>rootA</strong>"
   <pre> 
    &lt;input type="text" name="rootA1" /&gt;
    &lt;input type="text" name="rootA2 /&gt;
    &lt;input type="text" name="rootA3" /&gt;
   </pre>
2nd Root is "<strong>rootB</strong>"
   <pre> 
    &lt;input type="text" name="rootB1" /&gt;
    &lt;input type="text" name="rootB2 /&gt;
    &lt;input type="text" name="rootB3" /&gt;
   </pre></p>

<p>On blur if any of rootA is called call function fnRootA();.
On blur if any of rootB is called call function fnRootB();.</p>

<p>Again, I'm trying to make sure that for each iteration like 1 that the alternate root doesn't contain anything, else it sets the .val("") property to an empty string of the root being blurred.</p>

<p>My current code works for a single element but wanted to use find or search but not sure how to construct it..</p>

<pre>$("input[name='rootA1']").blur(function(e) {
   fnRootA(1); // this code just removes rootA1's value val("") 
              //if rootB1 has something in it value property
             // the (1) in parenthesis is the iteration number
});
</pre>
