HTML 表单

1.单行文本输入框

<html>
  <head>
  <title> 单行文本输入框 </title>
  </head>
  <body>
  <form action="###" method="get">
  输入你的姓名:
  <input type="text" name="yourname">
  <input type="submit" value="提交">
  </form>
  </body>
</html>



2.密码输入框

<html>
  <head>
  <title> 密码输入框 </title>
  </head>
  <body>
  <form action="###" method="post"> 
  输入你的姓名: 
  <input type="text" name="yourname"><br>
  输入你的密码:
  <input type="password" name="yourpw"><br>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



3.复选框(checkbox)

<html>
  <head>
  <title> 复选框 </title>
  </head>
  <body>
  <form action="###" method="post"> 选择你喜欢的水果: <br>
  <input type="checkbox" name="fruit" value="apple"> 苹果 <br>
  <input type="checkbox" name="fruit" value="banana"> 香蕉 <br>
  <input type="checkbox" name="fruit" value="orange"> 橘子 <br>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



4.复选框-缺省已选

<html>
  <head>
  <title> 复选框-缺省已选 </title>
  </head>
  <body>
  <form action="###" method="post"> 选择你喜欢的水果: <br>
  <input type="checkbox" name="fruit" value="apple" checked> 苹果 <br>
  <input type="checkbox" name="fruit" value="banana"> 香蕉 <br>
  <input type="checkbox" name="fruit" value="orange"> 橘子 <br>
  <input type="submit" value="提交">
  </form>
  </body>
</html>


5.单选框

<html>
  <head>
  <title> 单选框 </title>
  </head>
  <body>
  <form action="###" method="post"> 选择你喜欢的水果: <br>
  <input type="radio" name="fruit" value="apple" > 苹果 <br>
  <input type="radio" name="fruit" value="banana"> 香蕉 <br>
  <input type="radio" name="fruit" value="orange"> 橘子 <br>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



6.单选框-缺省已选

<html>
  <head>
  <title> 单选框-缺省已选 </title>
  </head>
  <body>
  <form action="###" method="post"> 选择你喜欢的水果: <br>
  <input type="radio" name="fruit" value="apple" checked> 苹果 <br>
  <input type="radio" name="fruit" value="banana"> 香蕉 <br>
  <input type="radio" name="fruit" value="orange"> 橘子 <br>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



7.下拉框(select)单选

<html>
  <head>
  <title> 下拉框-单选 </title>
  </head>
  <body>
  <form action="###" method="post"> 选择你喜欢的水果: <br>
  <select name="fruit">
  <option value="apple">苹果
  <option value="banana">香蕉
  <option value="orange">橘子
  </option>
  </select>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



8.下拉框-多选

<html>
  <head>
  <title> 下拉框-多选 </title>
  </head>
  <body>
  <form action="###" method="post"> 选择你喜欢的水果: <br>
  <select name="fruit"  multiple>
  <option value="apple">苹果
  <option value="banana">香蕉
  <option value="orange">橘子
  </option>
  </select>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



9.多行输入框(textarea)

<html>
  <head>
  <title> 多行输入框 </title>
  </head>
  <body>
  <form action="###" method="get"> 简单介绍自己: <br>
  <textarea rows="3" cols="50">
  </textarea>
  <br>
  <input type="submit" value="提交">
  </form>
  </body>
</html>



10.图片提交

<html>
  <head>
  <title> 图片提交</title>
  </head>
  <body>
  <form action="###" method="get"> 按钮图片: <br>
  <input type="image" src="http://www.blabla.cn/images/icons/go.gif" alt="提交" name="imagesubmit">
  </form>
  </body>
</html>







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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值