求大神详解 removeAttribute 恢复原始值为什么不会把head里的style也给移除

来源:4-1 编程挑战

EddyW

2015-08-08 16:54

求大神详解 removeAttribute 恢复原始值为什么不会把head里的style也给移除


function replace(){


var mychar= document.getElementById("txt");


var message=confirm("确认返回默认状态吗?")


if(message==true){


mychar.removeAttribute("style");}

else{};


}


写回答 关注

2回答

  • endenvor
    2015-12-17 14:06:50

    你没有加上head里面的样式

  • jaysky98
    2015-12-17 13:42:01

    清除内联样式

JavaScript入门篇

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

738662 学习 · 9561 问题

查看课程

相似问题