DOm知识2 添加删除元素

 // 添加元素
    // var ys=document.createElement("p");
    // var yb=document.createTextNode("这是新的");
    // ys.appendChild(yb)
    // document.getElementById("first").appendChild(ys)
    // 删除元素
    // var dl =document.getElementById("first");
    // var dr= document.getElementById("font")
    // dl.removeChild(dr);
    // 定时器开始/关闭
// var t=setInterval(function(){
//     var d=new Date();
//     console.log(d);
// },1000)
// document.getElementById("enter").onclick=function(){
//     clearInterval(t);
// }
var g=setTimeout(function(){
    alert("你的电脑已被感染")
},5000)
// document.getElementById("enter").onclick=function(){
//     clearTimeout(g)}
// window.onload=function(){}加载完运行,

document.getElementById("enter").onclick=function(){
   window.location.href="http://www.163.com" 

posted on 2020-05-07 14:28  vermouthmo  阅读(126)  评论(0)    收藏  举报

导航