Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>本教程(w3big.com)</title> </head> <body> 姓名: <input type="text" id="myText" placeholder="Name"> <p>点击按钮修改文本域的提示信息。</p> <button onclick="myFunction()">点我</button> <script> function myFunction() { document.getElementById("myText").placeholder = "在这输入姓名.."; } </script> </body> </html>