表单相关:
form表单:设置提交数据的地址和方式
按钮:
按钮的三个属性:submit提交按钮、reset重置按钮、button普通按钮
<button type='submit | reset | button'>按钮上显示的文字</button>
<input type=' submit | reset / button ' value='按钮上显示的文字'>
input的其他type属性值
语法:
<input type='text | password | radio | checkbox | file | hidden '>
file是文件
hidden是
隐藏域 : 提交不想被用户看到的数据的时候。【用value设置要提交的数据】
<input type='hidden' value='提交的数据’name='名字·>
其他标签:
1、lable标签
语法1:<input typy="radio" name="sex" id="id名">
<lable for="对应ID名">要关联的内容</lable>
注意:lable上面的for要和id设置的一样
语法2:<lable><input typy="radio" name="sex" id="id名"></lable>
注意lable上面不能有for属性
2、下拉列表(下拉框):
<select name="city" id="">
<option selected>北京</option>
<option value=“北京”>北京</option>
<option>北京</option>
<option>北京</option>
<option>北京</option>
<option>北京</option>
</select>
注意:option上有一个value属性,可写可不写,不写默认是提交option的值,写了就必须给value一个值,selected表示默认选中
像selected这种属性名和属性值一样的成为布尔属性
3、文本域
<textarea name="msg"></textarea>
注意:
两个标签之间不能加任何东西,包括空格和换行,因为它会把它保留下来
表单字段集(了解):
<filedest>
<legend>这是我写的</legend>
</filedest>