码迷,mamicode.com
首页 > Web开发 > 详细

html 表单初步学习

时间:2016-03-13 22:27:19      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

<html>

<head>
<title> 静态页面</title>
</head>

<body>

这是一个静态页面<br>

<!-- target: _blank -- 在新窗口中打开链接 
_parent -- 在父窗体中打开链接 
_self -- 在当前窗体打开链接,此为默认值 
_top -- 在当前窗体打开链接,并替换当前的整个窗体(框架页) -->

<a href = "https://www.baidu.com" target = "_blank">这是一个链接</a>

<br>
<h1>表单</h1>

<!--action:表单要提交的目的地址 method:表单中数据的提交方式-->
<form action = "action.html" method = "GET">
<!--文本框-->
姓名:<input type = "text" name = "name"> <br>
<!--单选框,对于一组元素,要保证他们的name属性相同-->
性别:<input type = "radio" name = "sex" value = "male"><input type = "radio" name = "sex" value = "female"><br>

学院:
<select name = "school">
<option value = "ht">航天学院</option>
<option value = "rw">软件与微电子学院</option>
</select>
<br>

<!--复选框,对于一组元素,要保证他们的name属性相同-->
爱好:
<input type = "checkbox" name = "hobby" value = "swimming">游泳
<input type = "checkbox" name = "hobby" value = "run">跑步
<input type = "checkbox" name = "hobby" value = "football">足球

<br>
密码:<input type = "password" name = "pswd"> <br>


<input type = "submit" value = "提交">
<input type = "reset" value = "重置">
<!--空格-->

&nbsp
</form> 

<!--表格:tr 元素定义表格行,th 元素定义表头,td 元素定义表格单元-->
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>


</body>

</html>

 

html 表单初步学习

标签:

原文地址:http://www.cnblogs.com/cjshuang/p/5273325.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!