使用javascript查找html页脚标记

Nis*_*tel -2 html javascript

我有html文件,有一个这样的页脚标签, <footer data-role="footer" data-theme="b"> <h4 > My Web Site </h4> </footer> 我想隐藏这个页脚使用javascript请帮助我.

jmd*_*din 7

你可以使用document.querySelectordocument.getElementsByTagName.

document.querySelector('footer').style = 'display: none'
Run Code Online (Sandbox Code Playgroud)