所属分类:web前端开发
在 HTML 中使用 placeholder 属性来显示描述元素预期值的提示。
您可以尝试运行以下代码来实现 placeholder 属性 -
<!DOCTYPE html> <html> <body> <h2>Login</h2> <form action = "/new.php"> <input type = "text" placeholder = "Student UserName" name = "name"/><br> <input type = "password" placeholder = "Password" name = "password"> <br><br> <input type = "submit" value = "Submit"> </form> </body> </html>