I have the following jquery snippets (used with each to iterate over a table of results):
$('.foo').children('.bar').children('.first_baz').text();
$('.foo').children('.bar').children('.second_baz').text();
I use this to access $firstvalue and $secondvalue:
<tr class='foo'>
<td class='bar'><span class='first_baz'>".$firstvalue."</span><span class='second_baz'>".$secondvalue."</span></td>
</tr>
This works but is it efficient? I suspect there is a better way to access these values… what is it?
If the first_baz and second_baz elements are just with in the table and no where else in the page then you can skip the children function use the following snippet:
If the above case doesn’t hold good then you can shorten the statements to