Home > Backend Development > PHP Tutorial > php如何清除已经echo的内容

php如何清除已经echo的内容

WBOY
Release: 2016-06-20 12:31:10
Original
2072 people have browsed it

如题
例如


echo "如何删除这一句话!";
  ?>



从已经显示的网页中删除上面那句话!


回复讨论(解决方案)

<script>window.onload=function(){	document.getElementById("main").innerHTML = "";}</script>
Copy after login

使用js,给id="main"赋值为空

用按钮怎么删除?

加个button再给按钮加点击事件就好啦


<script> <br />function foo(){ <br /> document.getElementById("main").innerHTML = ""; <br />} <br /></script>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template