!DOCTYPE htmlhtml class=no-js lang=zhhead meta charset=utf-8 title首页titleheadbody style ftn background-color #4CAF50; 绿色背景 border none; 去掉边框 color white; 字体颜色为白色
因为在disappear()函数中只是将按钮的display属性设置为'none',并没有将按钮从DOM中移除。如果想要彻底将按钮移除,可以使用remove()方法,即将代码修改为:
function disappear() { document.querySelector('.ftn').remove(); //移除按钮 }
原文地址: https://www.cveoy.top/t/topic/b3dK 著作权归作者所有。请勿转载和采集!