fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <p id="myP">这是个段落,点击按钮使该段落可编辑。</p> <button onclick="myFunction()">点我</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myP").contentEditable = true; document.getElementById("demo").innerHTML = "以上 p 元素现在可编辑,尝试修改文本。"; } </script> </body> </html>
运行结果