2010-01-19 101 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");