博客列表 >4. 实例演示表单以及常用控件元素的使用(必须掌握)

4. 实例演示表单以及常用控件元素的使用(必须掌握)

锋芒天下的博客
锋芒天下的博客原创
2019年07月03日 11:23:13640浏览

<!DOCTYPE html>

<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>0702-作业4</title>
</head>
<body>

   <h1>用户注册</h1>

   <form action="" method="get" name="register">
       <p>
           <label for="username">账号:</label>
           <input type="text" id="username" name="username" placeholder="请输入用户名" autofocus>
       </p>

       <p>
           <label for="password">密码:</label>
           <input type="password" id="password" name="password" placeholder="请输入密码">
       </p>

       <p>
           <label for="email">邮箱:</label>
           <input type="email" id="email" name="email" placeholder="3231228515@qq.com" required>
       </p>

       <p>
           <label for="age">年龄:</label>
           <input type="number" id="age" name="age" min="16" max="60">
       </p>
       
       <p>
           <label for="birthday">生日:</label>
           <input type="date" id="birthday" name="birthday">
       </p>
       
       <p>
           <label for="sourse">请选择:</label>
           <select name="aourse" id="sourse">
               <option value="">1</option>
               <option value="" selected>2</option>
               <option value="">3</option>
           </select>
       </p>

       <p>
       <label for="box">复选框:</label>
       <input type="checkbox" name="box" id="box" checked><label for="box">课程1</label>
       <input type="checkbox" name="box" id="bo"><label for="bo">课程2</label>
       <input type="checkbox" name="box" id="b"><label for="b">课程3</label>
       </p>


       <p>

           <label for="nv">单选框:</label>
           <input type="radio" id="nan" name="xingbie" checked><label for="nan">男</label>
           <input type="radio" id="nv" name="xingbie"><label for="nv">女</label>

       </p>

       <label for="text">文本框:</label>
       <textarea name="" id="text" cols="30" rows="10" maxlength="30" placeholder="请输入文字"></textarea>

       <p>
       <input type="submit" value="提交">
       <input type="reset" value="重置">
       </p>
       <button type="submit">提交</button>
       <button type="button">ajax提交</button>
   </form>


</body>
</html>

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议