a标签 href
image.png
1.<a href="qq.com">qq</a>
相当于打开。com文件
正规写法href=https://qq.com
2.不准用file协议,上传到github,用github预览功能
3.或者npm i -g http-server安装,直接做一个nodejsserver
http-server -c-1 不要缓存
![](https://img.haomeiwen.com/i3237223/1ea10cf28313e9a2.png)
![](https://img.haomeiwen.com/i3237223/c0273b6c6f7b4f53.png)
4.a href="//qq.com"
a标签的无协议绝对地址 自动继承协议
5.相对路径 a href="xxx.html"
跳转到/XXX.html
6.只写锚点#,href=“#bilibili”
直接加到index.html/#bilibili
注意:锚点是不发出请求的 (页面的跳转)
7.href="?name=张翼翔",系统自动判断,index.html?name=张翼翔。以此发起get请求
GET /index.html?name=frank HTTP/1.1
a标签的href设置成#
1.a href="#" 时表示一个空链接,点击时链接停留在当前页面,相当于刷新当前页面,有时使用该方法实现刷新本页面功能。
如果href是空白,点击后刷新页面同时请求一次
2.后面可以跟任意标签的id,或者任意a标签的id或者name,点击链接就可以跳转到当前页面的这个节点的位置
``<div id="abc"></div>
<a name="bcd"></a>
<a href="#abc"></a> /跳转到div id="abc"><//
<a href="#bcd"></a> /跳转到a name="bcd"><//
<a href="#"></a> /跳转到当前页面的顶部/``
a[href=#]*7>img[src=#][alt="..."]
![](https://img.haomeiwen.com/i3237223/764bb5eede99d692.png)
a和button
button不需要跳页面
点A按钮直接下载 其实是个跳转链接
![](https://img.haomeiwen.com/i3237223/eea6e2a45fc56248.png)
整个包分\
a标签的js伪协议
<a href="javascript: alert(1);" name="price"></a>
希望点击之后不要跳转
formbiaodan没有提交按钮 就无法提交,除非js
get获取内容,post上传
把东西提交到服务器
![](https://img.haomeiwen.com/i3237223/aa6f77af91764a10.png)
路径就是字符串,
![](https://img.haomeiwen.com/i3237223/8c7a9782ef267703.png)
请求第四部分
![](https://img.haomeiwen.com/i3237223/c42d6ca141713924.png)
urlencoded 把明文改成十六进制安文用百分号隔开
post默认把查询参数放到响应第四部分
get放url上
form a 标签都有target
![](https://img.haomeiwen.com/i3237223/75397e0e08fdd1ef.png)
提交到iframe里
a标签和form标签都能发请求,a是get页面,form是post
input 和button区别:input没有子元素
tpye难学,有很多属性,分别表示不同输入类型
<input type="button" value= "button">
method
属性规定如何发送表单数据,表单数据发送到 action 属性所规定的页面
method="get"
button
为什么button和subbmit区别
第一种情况,
<button>button</button>
button没写type,自动升级提交按钮
button 的 type 属性为 button,没法提交
submit是唯一确定能佛在form表单能不能点击提交的按钮
checkbox多选框
1.<input type="checkbox" value= "button">爱我
能勾,需要写些补充文字
2.写成<input type="checkbox" name=”loveme">
需要有内容才能提交上去
![](https://img.haomeiwen.com/i3237223/eb2e39e5923bc491.png)
选中了是on,没选就没值,不是off 加上value=”yes",返回yse
3.需要点爱我,自动勾选,那就<input type="checkbox" id="xxx"><label for="xxx"(不写#)>aiwo</label>
标签label是为了input准备的(for),点爱我就等于点input,label的作用就是跟input关联
![](https://img.haomeiwen.com/i3237223/48968f7410be7053.png)
4.添加label标签, for=“xxx",id=xxx,for和id是一对,要一起出现。这样点击用户名直接选中输入框
更先进写法:
![](https://img.haomeiwen.com/i3237223/4a7deceb9a176257.png)
删掉id和for,label把input包裹起来
input是label子元素,自动建立关联
name必须写,提交时候才能带上name后的值
radio 单选框
一个原点
![](https://img.haomeiwen.com/i3237223/43b5444a5e170e80.png)
![](https://img.haomeiwen.com/i3237223/f98f3286498ef47d.png)
涉及radio,单选框
![](https://img.haomeiwen.com/i3237223/776c67ad6c74bbb3.png)
select下拉列表
<select name="group" multiple(多选) >
<option value="">-</option>//可以给个空值 什么也不选的意思
<option value="1">第一组</option>
<option value="2">第二组</option>
<option value="3" disabled>第三组</option>选不了
<option value="4" selected>第四组</option>默认
textarea
<textarea style="resize: none; width:200px;height:100px;"name="爱好" id="" cols="30" 3列的意思不跟字的宽度严格一致rows="10"></textarea>
table
表头 th 表脚 tf tbudy
table data:td
th td区别
![](https://img.haomeiwen.com/i3237223/c98aafb11c9d3c43.png)
col和colgroup
![](https://img.haomeiwen.com/i3237223/23dab6f5646ca05e.png)
tfooter位置不影响顺序
不写tbody,系统自动补上
不写thead,都放进body里
网友评论