js特效

window
history 前进后退
location 地址栏
document 文档内容

history
history.forward() //前进到下个页面
history.back() //返回到上个页面

history.go(n);
n为-1 返回上个页面
n为1 前进下个页面
n为0 刷新当前页面

location.
host 设置和返回 主机名/URL的端口号
hostname 设置和返回 URL的主机名
href 设置和返回完整URL 可跳转
hash 设置和返回 #开始的URL
search 设置和返回 ?开始的URL

reload() 刷新
replace() 新文档替换当前文档


document

write()
getElementById() 根据id返回指定id的第一个对象
getElementsByTagName() 根据标签名返回指定名的对象集合
getElements ByName() 根据名字返回指定名的对象集合

innerHTML("content");

getElementByTagName("id").innerHTML=;
firstElementChild
lastElementChild

getElementsByTagName
getElementByTagName

getElementsByTagName()[0]

getAttribute("");
setAttribute("属性名",""属性值");

createElement
Anode.appendChild(Bnode)
insertBefore(Anode,Bnode)
node.cloneNode(true or false)
true克隆所有子节点 false克隆该节点 包括属性

removeChild(node) 删除节点
replaceChild(替换的节点,被替换的节点)

原文地址:https://www.cnblogs.com/m97i/p/6915917.html