您的位置:首页 > Web前端 > HTML

HTML中的表单元素

2016-06-05 22:15 351 查看
直接给个例子吧,这样比较直观:

<form action="http://www.baidu.com" method="get">
单行文本框:<input id="textfield" name="textfield" type="text"/><br/>
不能编辑的文本框:<input id="textfield1" name="textfield1" type="text" readonly="readonly"/><br/>
密码输入框:<input id="password" name="password" type="password"/><br/>
隐藏域:<input id="hidden" name="hidden" type="hidden"/><br/>
第一组单选框:
<input id="color1" name="color" type="radio" value="red">红色</input>
<input id="color2" name="color" type="radio" value="green">绿色</input>
<input id="color3" name="color" type="radio" value="yellow">黄色</input><br/>
定义复选框:
<input id="fruit1" name="fruit" type="checkbox" value="apple">苹果</input>
<input id="fruit2" name="fruit" type="checkbox" value="orange">橘子</input>
<input id="fruit3" name="fruit" type="checkbox" value="banana">香蕉</input><br/>
文件上传域:
<input id="file" name="file" type="file"/><br/>
图像域:
<input type="image" src="images/img.jpg" alt="图片"/><br/>
按钮
<input id="submit" name="submit" type="submit" value="提交"/>
<input id="submit1" name="submit1" type="submit" value="提交" disabled="disabled"/>
<input id="reset" name="reset" type="reset" value="重置"/>
<input id="button" name="button" type="button" value="按钮"/>
</form>


显示结果如下:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html 表单