DOm知识2 添加删除元素

时间:2020-05-07 14:35:46   收藏:0   阅读:35
 // 添加元素
    // 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" 

原文:https://www.cnblogs.com/vermouthmo/p/12842831.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!