footer点击添加active class

    //footer点击添加active class
    var indexFooter= document.querySelectorAll('#index_footer li');
    for (var i = 0;i < indexFooter.length; i++) {
        indexFooter[i].onclick=function(){
            document.querySelectorAll('#index_footer li').forEach(function (el) {
               el.classList.remove('active');
            })
            this.classList.add('active');
        }
    }
原文地址:https://www.cnblogs.com/theWayToAce/p/7641641.html