jquery鼠标点击开关切换

    //开关切换  无状态值切换 
    $("#swich_op").click(function(){
        console.log($(this).attr("src"));
        if($(this).attr("src") == "static/security_img/on.png"){
            $(this).attr("src","static/security_img/down.png")
        }
        else{
            $(this).attr("src","static/security_img/on.png")
        }
    })

posted @ 2019-05-06 10:55  QiuYuLing  阅读(538)  评论(0编辑  收藏  举报