HTML表单

来源:互联网 发布:芜湖网络推广 编辑:程序博客网 时间:2024/06/06 02:35

1.表单用于获取不同类型的用户输入;

2.常用表单标签:

<form>            表单

<input>           输入域

<textarea>     文本域

<label>          控制标签

<fieldset>       定义域

<legend>       域的标题

<select>        选择列表

<optgroup>   选项组

<option>        下拉列表中的选项

<button>       按钮


代码示例如下:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>表单</title></head><body>    <form>        用户名:        <input type="text"><br/>        密码:        <input type="password">        <br/><br/>        你喜欢的水果有?<br/>        <input type="checkbox">苹果        <input type="checkbox">香蕉        <input type="checkbox">梨        <input type="checkbox">葡萄        <br/><br/>        您的性别:        <input type="radio" name="gender">男        <input type="radio" name="gender">女        <br/><br/>        你最喜欢的网站:        <select>            <option>百度</option>            <option>腾讯</option>            <option>谷歌</option>            <option>京东</option>        </select>        <br/><br/>        <input type="button" value="确定">        <input type="submit">        <br/><br/>    </form>    评论:    <textarea cols="30" rows="20">请输入您想说的话:</textarea></body></html>

运行效果如下:


github主页:https://github.com/chenyufeng1991  。欢迎大家访问!

1 0
原创粉丝点击