change img src on click

前端 未结 5 1139
感动是毒
感动是毒 2020-12-06 02:08

I have searched the forum for one particular issue, yet all the solutions I found do not work for my problem.

I have an image on the left hand side. On the right han

5条回答
  •  萌比男神i
    2020-12-06 02:43

    The second one works fine but you have to use explicit path instead of relative path:

    $('#mtl').click(function(){
    $('#picture').attr('src', '/images/short.png');
    });
    

提交回复
热议问题