Changing the image source using jQuery

前端 未结 16 2304
天命终不由人
天命终不由人 2020-11-22 01:24

My DOM looks like this:

16条回答
  •  忘了有多久
    2020-11-22 02:06

    I have the same wonder today, I did on this way :

    //myImage
    $('.myClass').attr('src','').promise().done(function() {
    $(this).attr('src','img/new.png');  
    });
    

提交回复
热议问题