form 表单

2017-12-09  本文已影响0人  崔敏嫣

form表单用于收集填写的信息,提交后台,表单的元素用form包括所有的元素,形成完整的数据。

form表单常见标签的使用注意事项:

<form action="" method="post">
  <div>
    <lable>姓名:</lable>
    <input type="text" name="username" value="" placeholder="用户名">
  </div>
  <div>
    <lable>密码:</lable>
    <input type="password" name="password" value="123456" >
  </div>
  <div>
    <lable>性别:</lable>
    <input type="radio" name="sex" value="men" checked="cehcked">男
    <input type="radio" name="sex" value="women">女
  </div>
  <div>
    <lable>我的爱好:</lable>
    <input type="checkbox" name="myhobby" value="dota">dota 
    <input type="checkbox" name="myhobby" value="trvale" checked="cehcked">旅游
     <input type="checkbox" name="myhobby" value="pet" checked="cehcked">宠物
  </div>
  <div>
    <lable>评论:</lable>
    <textarea name="commnet" cols="60" rows="10">
    </textarea>
  </div>
  <div>
    <lable>我梦想的car:</lable>
    <select>
      <option>兰博基尼</option>
       <option>玛莎拉蒂</option>
    </select>
  </div>
  <div>
    <input type="hidden" name="123456" value="阿拉丁神灯">
  </div>
<div>
    <input type="file" accept="image/png">
  </div>
 <div>
    <button>普通按钮</button>
    <input type="button" name="button" value="提交">
    <input type="button" name="reset"  value="重置">
  </div>
  </form>
form表单的简单应用
上一篇 下一篇

猜你喜欢

热点阅读