开发者

Help with a jQuery selector

 <div class="divorder">     
     <table class="formfieldsmall">       
        <tr>
           <td style="width: 2%;">
               <img class="trigger" src="/SPLockerWebApp/Assets/themes/default/images/p开发者_StackOverflowlus.png" />               
           </td>
        </tr>
     </table>
</div>

I need to change the image, but the following is not working in IE:

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

Can anybody tell me the right option? I have bind click event on divorder.

$(this).next("trigger").src like this


You might be better off using the find method

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


$(this).next("trigger").attr("src", "some/path/to/image.png");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜