首页 > 网站 > WEB开发 > 正文

input两种默认显示文字方式

2024-04-27 14:25:32
字体:
来源:转载
供稿:网友
input两种默认显示文字方式

First Note:

placeholder属性规定帮助用户填写输入字段的提示,值不会被提交, 且该提示会在输入字段为空时显示,并会在字段获得焦点时消失。

<input type="text" name="tname" placeholder="请在这里输入用户名">

<input type="text" name="tname" placeholder="<?phpif (! empty ( $_session ['tname'] )) {echo $_SESSION ['tname'];}?>">

value属性 规定 input 元素的值,值会被提交

<input type="text" name="tname" value ="admin" placeholder="请在这里输入用户名">

<input type="text" name="tname" value ="admin"placeholder="<?phpif (! empty ( $_SESSION ['tname'] )) {echo $_SESSION ['tname'];}?>">


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表