表单的基本使用

login.html

<html>
<head>
<title>登陆网页</title>
</head>
<!--action的值应当是提交哪个页面(url)-->
<!--method方法指定提交数据的方法,常用的有两种get/post-->
<form action = "ok.html" method = "get">
用户名:<input type = "text" name = "username"/><br/>
密  码:<input type = "password" name = "password"/><br/>
<input type = "submit" name = "登陆系统"/>
<input type = "reset" value = "重新填写"/>
</form>
</html>

ok.html

OK,登陆页面成功!

 

单选框,多选框,文本域,文件上传控件

<html>
<head>
<title>表单元素</title>
</head>
<form action = "ok.html" method = "get">
你最喜欢哪个城市:
<input type = "checkbox" name = "cities" value = "beijing">北京
<input type = "checkbox" name = "cities" value = "shanghai">上海
<input type = "checkbox" name = "cities" value = "London"/>伦敦<br/>
您的性别:
<input type = "radio" name = "sex" value = "man">男
<input type = "radio" name = "sex" value = "woman">女<br/>
隐藏域的使用
<input type = "hidden" name = "data" value = "OK"/>
下拉列表<br/>
请选择您的出生地:
<select name = "address" size = "3" multiple>
<option value = "sichuan">四川</option>
<option value = "beijing">北京</option>
<option value = "xizang">西藏</option>
</select><br/>
<!--文本域-->
<textarea cols = "40" rows = "10">
</textarea><br/>
<!--文件上传的控件-->
<input type = "file" name = "myfile">上传文件<br/>

<input type = "submit" name = "测试" value = "test"/><br/>
<!--这是一个图片按钮-->
<input type = "image" src = "image.png"/>
</form>
</html>

<html>
<body>
<fieldset style = "width:300px">
<legend><font>★ 审核状态</font></legend>
<form>
<input type = "radio" name = "state"/>已经审核
<input type = "radio" name = "state"/>没有审核
<input type = "radio" name = "state"/>全部
</form>
</fieldset>
</body>
<html>



已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页