JQuery Selector - Finding an img in a table

Posted by CccTrash on Stack Overflow See other posts from Stack Overflow or by CccTrash
Published on 2010-03-08T08:06:53Z Indexed on 2010/03/08 8:21 UTC
Read the original article Hit count: 340

Filed under:
|

Cant seem to get the following to find the 'skull' button when the 'heart' button is clicked...

Here is the JQuery...

           $(".voteup").click(function() {
                var id = $(this).attr("title");
                var userID = $('[id$=HiddenFieldUserID]').val();
                var ipAddress = $('[id$=HiddenFieldIPAddress]').val();
                var skullButton = $(this).parent().siblings(".votedowntd").children("votedown");
                registerUpVote("up", id, $(this), skullButton, userID, ipAddress);
            });

And the HTML...

        <table width="200px">
            <td width="35px" class="votedowntd">
                <img src='<%# (bool)Eval("skull") ? "images/skull.png" : "images/skull-bw.png" %>' alt="Vote Down" class="votedown" title='<%# Eval("entry.ID") %>' />
            </td>
            <td width="130px" style="text-align: center;">
                Num Votes Goes Here
            </td>
            <td width="35px" class="voteuptd">
                <img src='<%# (bool)Eval("heart") ? "images/heart.png" : "images/heart-bw.png" %>' alt="Vote Up" class="voteup" title='<%# Eval("entry.ID") %>' />
            </td>
            <tr>
            </tr>
        </table>

So basically what I need to do is when one img is clicked, I need to find the other one.

Why is what I have not working? Is there a better way to do this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ASP.NET