HTML表单练习

来源:互联网 发布:杭州网络教育专升本 编辑:程序博客网 时间:2024/06/04 00:30

最近学车啊,明天还要出去在外地练,电脑都摸不到了=-=


HTML 表单用于搜集不同类型的用户输入,主要用于收集网页上浏览者的信息。HTML5 Input,拥有多个新的表单输入类型,提供了更好的输入控制和验证。


表单是一个包含表单元素的区域。
表单元素是允许用户在表单中(比如:文本域、下拉列表、单选框、复选框等等)输入信息的元素。
表单使用表单标签(<form>)定义。
<form> <input /></form>[1]


<!DOCTYPE html><html>    <head>        <meta charset="utf-8">        <title>这是一个form练习1</title>    </head>    <body>        <form class="" action="index.html" method="post">            请输入您的姓名            <input type="text" name="yourname" id="field1" size="20" maxlength="15" value="测试1?">            <br>            请输入您的地址            <input type="text" name="youradr" id="field2" size="20" maxlength="15" maxlength="15" >            <br>            <input type="button" name="copy" value="复制" onclick="document.getElementById('field2').value=document            .getElementById('field1').value">            <br>            请输入您最新的工作情况 <br>            <textarea name="ll" rows="8" cols="80"></textarea>            <br>            单选按钮 <br>            您的兴趣是:            <br>            <input type="radio" name="book" value="book1">黑客攻防 <br>            <input type="radio" name="book" value="book2">办公软件 <br>            <input type="radio" name="book" value="book3">设计软件 <br>            <input type="radio" name="book" value="book4">网络管理 <br>            <br>            复选框 <br>            <input type="checkbox" name="box" value="box1">黑客攻防 <br>            <input type="checkbox" name="box" value="box2">办公软件 <br>            <input type="checkbox" name="box" value="box3">设计软件 <br>            <input type="checkbox" name="box" value="box4">网络管理 <br>            <br>            email属性            <input type="email" name="em" value="输入邮箱地址">            <br>            <input type="submit" name="sub" value="提交">            <input type="reset" name="res" value="重置">            <br><br><br><br>            创建用户反馈表单            <h1 align=center>用户反馈表单</h1>            <p>性    名            <input type="text" class=txt size=12             maxlength = "20" name = "usr_name"></p>            <p>性    别:            <input type="radio" name="male" value="male">男            <input type="radio" name="female" value="female">女</p>            <p>年    龄:            <input type="text" name="age" value="">            </p>            <p>联系电话:            <input type="text" class = txt name="tel" value="">            </p>            <p>                电子邮件:                <input type="text" class = txt name="mail" value="">            </p>            <p>                联系地址:                <input type="text"  class = txt name="adr" value="">            </p>            <p>                请输入您对网站的建议: <br>                <textarea name="yourworks" clos = "50" rows = "5" value=""></textarea>            </p>            </p>                    <input type="submit" name="submit" value="提交"/>                    <input type="reset" name="resset" value="清除"/>                                </p>        </form>    </body></html>


0 0
原创粉丝点击