How does jquery get the parent tr of an element

<table>
    <tr>
        <td>1</td>
        <td><span>22</span></td>
        <td><span><input type="text" id="ipt1"></span></td>
    </tr>
    <tr>
        <td>1</td>
        <td><span>22</span></td>
        <td><span><input type="text" id="ipt2"></span></td>
    </tr>
    ...
</table>

for example, this -sharpipt1 , what is the most convenient way to get the tr where it is located? Use jquery

Jun.23,2022

$('- sharpipt') .parent () can be obtained.


$('- sharpipt1'). Parent


var tr = $("-sharpipt1").parents("tr");
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e59e38-44cf5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e59e38-44cf5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?