开发者

how to change html image src by j-query

开发者 https://www.devze.com 2023-01-19 06:13 出处:网络
view.aspx <img src =\"~/UserControls/Vote/Images/Arrow Up.png\" id = \"voteupoff\" runat = \"server\" alt =\"vote up\"

view.aspx

<img src ="~/UserControls/Vote/Images/Arrow Up.png" id = "voteupoff" 
            runat = "server" alt ="vote up" 
    class="voteupImage" style="height: 45px; width: 45px"/>

i wnat to change it src ~/UserControls/Vote/Images/aftervoteupArrowUp.png when click on image i means

view.js

    $('img.voteupImage').live('click', function() {

 $('img.voteupImag开发者_如何学JAVAe').attr('src', aftervoteUp);
     }
but it's not working..


$('img.voteupImage').live('click', function() {
    $(this).attr('src', aftervoteUp);
});
0

精彩评论

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