<input>标签
<input>标签声明允许用户输入数据的input控件,输入数据的方式有很多,取决于type属性。
type: number、time、year、month、data、url、email、image、range、file、search、submit、button、text、tel(电话号码字段)、radio、checkbox。
input标签属性介绍:
accept属性
规定上传文件服务器接收的文件类型,仅适用于type="file",accept属性值有:audio/*、video/*、image/*、MIME_type。
例:当accept="image/*"时,type="file",控件为上传文件类型。
<form action="xxx.php">
上传的文件:<input type="file" name="input1" accept="image/*"><br>
<input type="button" name="but1" value="提交">
</form>
alt属性
alt属性规定,当type="image"时,用户由于某些原因(如网络差、图片路径不正确等)无法查看图像时,可以用alt提供替代文本。
<form action="demo_form.php">
First name: <input type="text" name="fname"><br>
<input type="image" src="submit.gif" alt="Submit" width="48" height="48">
</form>
<p>点击图片,输入框将被发送到服务器的“demo_form.php”页面。</p>
<p><b>注意:</b> 如果 type 属性设置为 image,当用户单击图像时,浏览器将以像素为单位,将鼠标相对于图像边界的偏移量发送到服务器,其中包括从图像左边界开始的水平偏移量,以及从图像上边界开始的垂直偏移量。</p>
checked属性
checked属性规定当<input>元素的type="checkbox"或type="radio"时,是否预先选择。
水果<input type="checkbox" name="input4" checked><br>
蔬菜<input type="checkbox" name="input5"><br>
足球<input type="radio" name="input6" checked>
篮球<input type="radio" name="input6">
disabled属性
disabled发展规定是否禁用<input>元素。当<input>元素禁用时,用户不能进行数据输入。
帐号:<input type="text" name="input7" ><br>
密码:<input type="password" name="possword"disabled >
placeholder属性
placeholder属性规定<input>元素提示用户输入数据。
姓名:<input type="text" name="input8" placeholder="请输入姓名"><br>
<input type="submit" name="sub3" value="提交">
min、max属性
规定<input>元素输入数据的最小、最大值。
maxlength属性
规定<input>元素中输入数据的最大字符长度。
<input type="text" name="usrname" maxlength="10">
以上输入的数据是长为10个字符,即使再输入也没有反应。
我真是服了他猴子了,自己敲得代码,自己截的图,没保存界面一切换就直接没有了,说好的自动保存草稿去哪了?
继续写。
坑爹的自动保存,养成一个及时保存的习惯是很重要的。