<tr>
<th scope="row">
<span id="home_location_indicator">(Home)</span>
</th>
<td>
<span class="postal_code_display">...</span>
</td>
<td><input value="1" name="location_select" type="radio" /></td>
</tr>
たとえば、上記のような<table>カップルを含む があります。<tr>の中で、<tr>を持っているのは 1 つだけ<span id="home_location_indicator">(Home)</span>です。
含まれている に属する入力の値を取得するためのアプローチを決定しようとしています。name="location_select"<tr><span id="home_location_indicator">
私が考えることができる2つのアプローチは次のとおりです。
$("tr").has("#home_location_indicator").find('input[name="location_select"]').val()$("#home_location_indicator").parents("tr").find('input[name="location_select"]').val()
どちらがより良いアプローチですか?なぜ?それとも問題ですか?