2010-03-08 5 views
0

캔트에 IMG을 보인다 찾기하여 '마음'버튼을 클릭하면 ... '해골'버튼을 찾아 다음 다음 JQuery와 선택기 - 얻을 수있는 테이블

JQuery와는 ...입니다

그리고 HTML

  $(".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); 
      }); 
...
 <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> 

그래서 기본적으로 내가해야 할 일 IMG를 클릭했을 때, 나는 다른 일을 찾을 필요가있다 필요.

내가 왜 작동하지 않습니까? 이 작업을 수행하는 더 좋은 방법이 있습니까?

답변

2

이 그것을 수행해야합니다

$(this).closest('table').find('.votedown'); 
+0

굉장합니다. 공장. 감사. – Jason