I have a table structure with a multiple rows containing a checkbox
input and 4 text inputs with distinct classes. I want to prefill two
of the text inputs in the same row where the checkbox is checked.
Example code for the first two rows:

<table>
 <tr id="row1">
   <td><input type="checkbox" /></td>
   <td><input type="text" class="email" /></td>
   <td><input type="text" class="contact" /></td>
   <td><input type="text" class="realname" /></td>
   <td><input type="text" class="sport" /></td>
 </tr>
  <tr id="row2">
   <td><input type="checkbox" /></td>
   <td><input type="text" class="email" /></td>
   <td><input type="text" class="contact" /></td>
   <td><input type="text" class="realname" /></td>
   <td><input type="text" class="sport" /></td>
 </tr>
</table>

I need help me crafting the correct selector to focus control onto the
text input for the input with class="contact" and class="email". I can
write the function to manipulate the attributes but I can't figure out
the selector. I haven't had any luck with "prev ~ siblings" or "prev +
next". Thanks in advance.

Reply via email to