老师,请帮忙检查,还有我的value这样写对吗,
来源:3-4 编程练习
慕神8387157
2019-05-06 10:42:51
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>lx9</title>
</head>
<body>
<form action="lx9.html" autocomplete="on">
<p>用户名: <input type="text" name="username" value="username" placeholder="请输入姓名" /></p>
<p>邮箱: <input type="email" name="email" value="email" autocomplete="off"/></p>
<p>手机号码: <input type="tel" name="phonenumber" value="phonenumber" autocomplete="off"/></p>
</form>
</body>
</html>
placeholder的文字被value的文字覆盖了
1回答
好帮手慕慕子
2019-05-06
同学你好, 这种语法是没有错误的, 不过因为input标签的特性,value没有值的时候才会显示placeholder中的文字。 value有值的时候就显示value中的内容。
另,同学代码实现了效果。 根据练习要求, 可以不设置value和placeholder属性哦~~示例:

如果帮助到了你, 欢迎采纳!
祝学习愉快~~~
相似问题