2010-01-19 131 views
1
<div class="divorder">  
    <table class="formfieldsmall">  
     <tr> 
      <td style="width: 2%;"> 
       <img class="trigger" src="/SPLockerWebApp/Assets/themes/default/images/plus.png" />    
      </td> 
     </tr> 
    </table> 
</div> 

我需要改變形象,但下面不工作在IE:幫助jQuery選擇

$(this).children()[0].children[0].all[2].src 

可有人告訴我正確的選擇?我已經綁定了divorder上的點擊事件。

$(this).next("trigger").src這樣

+1

放一些精力投入到你的問題,或者沒有人會打擾回答它。在三行以上解釋問題是什麼,代碼是什麼樣的,並且可能會發布指向顯示問題的在線版本的鏈接。 – Marius 2010-01-19 17:00:24

+0

他寫得夠多我想: '我需要改變圖片' 並給了我們一些代碼 '$(this).next(「trigger」)。src' 這很容易理解他需要什麼。但無論如何你是對的。他可以寫更多關於他的問題,讓每個人都明白。 – kjagiello 2010-01-19 17:01:56

回答

1

你可能會更好使用find方法

$('.divorder').click(function(){ 
    $(this).find('img.trigger').attr({src: 'some/image/path.png'}); 
}); 
1
$(this).next("trigger").attr("src", "some/path/to/image.png");