DOM

1.对话框

 <script>
       alert('1234')
        // confirm('确认删除吗')
        var ddd = prompt('请输入年龄', '10')
    //定时器
        setInterval(code, delay);
       //清除定时器 clearInterval(interval)
    //延迟器
        setTimeout(code,delay)
 </script>    

 2跳转

//将地址栏改为跳转地址
location.href=地址
document
getElementById() 返回对拥有指定 id 的第一个对象的引用。 
getElementsByName() 返回带有指定名称的对象集合。 
getElementsByTagName() 返回带有指定标签名的对象集合。 

//页面加载事件,直接执行
onload=function(){
   //事件绑定
document.getElementByid(id).onclick = function(){代码}
};

event 事件属性 写在标签属性中
<标签 event=函数名(例
onkeyup="SomeJavaScriptCode")>
创建结点
var a = document.createElement('a');
a.href='11.html'
a.innerHTML='点击显示' //成对的标签要用innerHTML;</结束>
document.getElementByid('id').apendChild(a) //加入到相应div中去
原文地址:https://www.cnblogs.com/mxz1994/p/7042201.html