网站首页 » js » JQ each遍历html标签

JQ each遍历html标签

September 3, 2018 js
    $("#lang>li>a").each(function(){
        var href=$(this).attr("href");
        var url=window.location.pathname;
        var url=url.replace('/en/','');
        var url=url.replace('/tn/','');
        var url=url.replace('/zh/','');
        $(this).attr("href",href+url);
    });
Title - Artist
0:00