What is the better way to get a parent node for the following example of code?
...
<tr>
<td>
<table>
<tr>
<td>
<div class="block_data">
Hello world!!
</div>
</td>
</tr>
</table>
</td>
</tr>
/*Javascript code 1*/
$('.block_data').parents('tr').first()...
/*Javascript code 2*/
$('.block_data').parent().parent()...
Which of the two codes is faster (considering perfomance, not coding)? Imagine a situation like that, with a lot of parents:
...
<tr>
<td>
...
</td>
</tr>
...
<tr>
<td>
<div>
<div>
<div>
<div class="block_data">
Hello world!!
</div>
</div>
</div>
</div>
</td>
</tr>