首页 > 代码库 > JS DOM

JS DOM

DOM操作

var b = document.getElementById("id");

b.onclick=function (){ 执行代码 }


var a = window.open()

a.close()

window.opener.close()

window.close()


window.scrollTo(x,y)


window.history.go(number)


var c = window.location.href

window,location.href = "http://www.mamicode.com/url";

JS DOM