0

Hi!

I have the following table:

<table width="63%" border="0" align="right" cellpadding="0" cellspacing="0" class="findUsResults">
<tr>
    <th align="left">Company</th>
    <th align="left">Location</th>
    <th align="left">Products offered</th>
    <th align="left">Distance</th>
</tr>
<tr>
    <td rel='1'>Company Ltd</td>
    <td>Town</td>
    <td><a href="/stockists/ajax.php?id=3" class="various fancybox.ajax">Click to view</a></td>
    <td>0.9 mil</td>
</tr>
<tr>
    <td rel='2'>Company Ltd</td>
    <td>Town</td>
    <td><a href="/stockists/ajax.php?id=5" class="various fancybox.ajax">Click to view</a></td>
    <td>11.56 mil</td>
</tr>
<tr>
    <td rel='3'>Company Ltd</td>
    <td>Town</td>
    <td><a href="/stockists/ajax.php?id=1" class="various fancybox.ajax">Click to view</a></td>
    <td>11.67 mil</td>
</tr>
<tr>
    <td rel='4'>Company Ltd</td>
    <td>Town</td>
    <td><a href="/stockists/ajax.php?id=6" class="various fancybox.ajax">Click to view</a></td>
    <td>14.5 mil</td>
</tr>
</table>

And I want to get the rel value when the user clicks on the row but the following code doesnt return anything...

$('.findUsResults tr').css({cursor:'pointer'})
            .click(
                function(){
                    var markerId = $($(this).find('td:nth-child(1)').children()[0]).attr(\"rel\");
                    infowindow.open(map, markerId);
                    console.log(markerId);
                }
);

Help pleasee!
Thanks,
Dan

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Danny159
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.