开发者

Help with a jQuery selector

开发者 https://www.devze.com 2022-12-17 16:43 出处:网络
<div class=\"divorder\"> <table class=\"formfieldsmall\"> <tr> <td style=\"width: 2%;\">
 <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

精彩评论

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