0
点赞
收藏
分享

微信扫一扫

input之type属性

和谐幸福的人生 2022-02-04 阅读 151
html5html

input标签中的type属性的属性值:

input标签中包含一个type属性,根据不同的type属性值输入的字段有很多种形式的表现方式:

<input type="text">				<!--定义单行输入字段,文本格式。默认宽度为20个字符-->
<input type="password">			<!--定义单行输入字段,掩码加密格式-->
<input type="checkbox">			<!--定义复选框-->
<input type="file">				<!--定义输入字段和"浏览"按钮,供文件上传-->
<input type="hidden">			<!--定义隐藏的输入字段-->
<input type="image">			<!--定义图像形式的提交按钮-->
<input type="radio">			<!--单选按钮-->
<input type="reset">			<!--定义重置按钮。重置按钮会清楚表单中的所有数据-->
<input type="submit">			<!--定义提交按钮。提交按钮会把表单数据发送到服务器-->

补充:

input的type属性的默认值为"text",不输入或者输入错了都默认属性值为"text"

1.<input type="text">
2.<input type="随便输入一个">
3.<input type="">

这段代码的结果是:
在这里插入图片描述

举报

相关推荐

0 条评论