jquery 怎么获取小弟我要的元素ID

jquery 如何获取我要的元素ID
本帖最后由 Cybernet 于 2015-04-29 18:20:17 编辑
我想通过 ID=“T5” 的元素  如何找到 ID=“T3”的元素ID ?
jQuery 谢谢!


<table border="1" width="100%">
<tr>
<td>
            <input type="text" id="T1" size="20">
            <input type="text" id="T2" size="20">
            <input type="text" id="T3" size="20">
</td>
 <td>
   <input type="text" id="T4" size="20">
           <input type="text" id="T5" size="20">
           <input type="text" id="T6" size="20">
</td>
</tr>
</table>





------解决思路----------------------
alert($("#T5").parent().prev().find("input:last").attr("id"));

------解决思路----------------------
引用:
alert($("#T5").parent().prev().find("input:last").attr("id"));

 

这才是正解 。