问答详情
源自:3-6 控制类名(className 属性)

removeAttrubite怎么用


            function hf(){
                var uu = document.getElementById("lm");
                var ml = confirm("是否恢复类名?")
                if(ml==true){
                    ml.removeAttribute("className")
                }
            }

这么做不对么,为什么恢复不了

提问者:心念阳 2016-11-11 22:41

个回答

  • 老友丶
    2016-11-11 23:26:58

    应该用uu调用啊,节点调用方法。uu.removeAttribute()。ml是一个一个布尔类型的常量。