表单元素格式
属性 | 说明 |
type | 指定元素的类型,文本框text,密码框password,多选框checkbox,单选框radio,提交按钮submit,重置按钮reset,文件框file,隐藏hidden,图片框image,按钮button |
name | 指定表单元素的名称 |
value | 元素的初始值,type为单选框radio时必须指定一个值 |
size | 指定表单元素的初始宽度,当type为text或者password时,表单元素的大小以字符为单位,对其他的类型,宽度以像素为单位 |
maxlength | type为text或password时,输入的最大字符数 |
checked | type为radio或者checkbox时,指定按钮是否被选中 |
单选框
![](https://img-blog.csdnimg.cn/2021022222280948.png)
上为显示效果,下为代码
<form method="get" action="result.html">