HTML表单

1.表单的结构

  结构: 

    <form 属性="属性值">

          控件

    </form>

 常见属性:

     name :表单的识别名称;

    action :处理表单数据程序的地址;

.   method :把表单中的数据提交给服务器端的方法(get/post) ;

2 表单包含的表单元素

   <input type="text">               单行文本框

   <input type="password">    密码文本框

  <input type="submit">           提交按钮

   <input type="image">           图片提交

   <input type="reset">             重置按钮

   <input type="button">          普通按钮

   <input type="hidden">          隐藏元素

   <input type="radio">             单选按钮

   <input type="checkfox">      复选框 

   <input type="file">                  文件域

   <select></select>                    列表框

  <textarea></textarea>             多行文本框

<form method="post" enctype="multipart/form-data">
		姓名:<input type="text" name="name" value="wyy" width="100px" 
                  maxlength="最长字符"/><br /><br />
		密码:<input type="password" name="password" value="" width="100px"/><br />
		性别:<input type="radio" name="gender"  value="男" checked="checked" />男
			 <input type="radio" name="gender"  value="女" />女 
				<br />
		兴趣:<input type="checkbox" name="hobby" value="smoke" />吸烟
			 <input type="checkbox" name="hobby" value="drin" />喝酒
		   	 <input type="checkbox" name="hobby" value="perm" />烫头
				<br />
		专业:<select name="major" size="1">
			    <option value="" selected="selected">软测</option>
				<option value="">软工</option>
				<option value="">软娱</option>
			</select>
				<br />
		自我评价:<br /><textarea name="text" cols="88" rows="5"></textarea>
				<br />
		上传文件:<input type="file" name="files" />
			<br />
		<input type="hidden" value="隐藏"   />
		<input type="submit" value="提交" />
		<input type="reset" value="重置" />
</form>

结果如图:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

RWTHeart

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值