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 @   QiuYuLing  阅读(538)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示