From c95163294f03e863d1bbd7c563e3a79fe25cbf6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Mon, 21 Nov 2022 04:16:44 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=2011.17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "30\351\273\204\351\233\204/11.17/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "30\351\273\204\351\233\204/11.17/.keep" diff --git "a/30\351\273\204\351\233\204/11.17/.keep" "b/30\351\273\204\351\233\204/11.17/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From c9b18258b242452b95e222013dc83f7c6fe5cd13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Mon, 21 Nov 2022 04:17:22 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=2011.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "30\351\273\204\351\233\204/11.18/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "30\351\273\204\351\233\204/11.18/.keep" diff --git "a/30\351\273\204\351\233\204/11.18/.keep" "b/30\351\273\204\351\233\204/11.18/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 065cb469d6c8b97c31e9b29d319eab48eb1d7b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Mon, 21 Nov 2022 04:17:57 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E9=BB=84=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄雄 <3218770186@qq.com> --- "30\351\273\204\351\233\204/11.17/30.html" | 38 ++++++ "30\351\273\204\351\233\204/11.17/zuoye.html" | 124 ++++++++++++++++++ .../11.17/\347\254\224\350\256\260.md" | 53 ++++++++ 3 files changed, 215 insertions(+) create mode 100644 "30\351\273\204\351\233\204/11.17/30.html" create mode 100644 "30\351\273\204\351\233\204/11.17/zuoye.html" create mode 100644 "30\351\273\204\351\233\204/11.17/\347\254\224\350\256\260.md" diff --git "a/30\351\273\204\351\233\204/11.17/30.html" "b/30\351\273\204\351\233\204/11.17/30.html" new file mode 100644 index 0000000..633923f --- /dev/null +++ "b/30\351\273\204\351\233\204/11.17/30.html" @@ -0,0 +1,38 @@ + + + + + + + + Document + + + + +
+ +
+ + + + \ No newline at end of file diff --git "a/30\351\273\204\351\233\204/11.17/zuoye.html" "b/30\351\273\204\351\233\204/11.17/zuoye.html" new file mode 100644 index 0000000..d2cb349 --- /dev/null +++ "b/30\351\273\204\351\233\204/11.17/zuoye.html" @@ -0,0 +1,124 @@ + + + + + + + Document + + --> + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
郑玮喆庄云廖治先郑文源戴俊锋陈昊童谢金金占志新张淑芳刘永潘廖柏成
郑宗帅李韦峰吴欣燕陈梅香陈立智袁贵森赵浩敏林世涛罗启恒卢国建黄柱菘
陈鹏张耀仁陈华伟张正豪韦仲晓黄富贵陆建锋曾德森吴文龙陆利群黄雄
王世财张先杰胡基耀马鑫涛李涛杨凌翔罗此东唐皓颖白婉婷
+ + + \ No newline at end of file diff --git "a/30\351\273\204\351\233\204/11.17/\347\254\224\350\256\260.md" "b/30\351\273\204\351\233\204/11.17/\347\254\224\350\256\260.md" new file mode 100644 index 0000000..05aadc2 --- /dev/null +++ "b/30\351\273\204\351\233\204/11.17/\347\254\224\350\256\260.md" @@ -0,0 +1,53 @@ +//弹窗输入 + +window.prompt('请输入') + +//弹窗 + +window.alert('警告') + +//确认框:点击确认返回true,取消返回flase + +var result =window.confirm('确定取消吗?'); + +​ if(result){ + +​ alert('痛失600w'); + +}else( + +​ alert('成功躲过骗局'); + +) + +//定时器:seTimeout():在设定的毫秒数后调用函数或计算表达式 + +//HTMLcollection 数组 + +​ var img=document.getElementsByTagName('img')[0]; + +​ const imgArr=['图片','图片']; + +​ var count=0; + +定时器 +setlnterval(); + +语法 + +setInterval(code,millisec,lang) + +//设定时器,3秒后出结果 + +​ st=setinterval(fn,3000); + +setTimeout() + +语法 + +setTimeout(code,millisec,lang) +浏览器对象模型(BOM)是以 window 对象为基础的,这个对象代表了浏览器窗口和页面可见的区域。 + +主要包括window、history、location和document等对象,其中window对象是整个BOM的顶层对象。 + +onclick(点击) \ No newline at end of file -- Gitee From 10dcbcfb7f32ccbb9957b98da55de78bf6dece5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9B=84?= <3218770186@qq.com> Date: Mon, 21 Nov 2022 04:18:41 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E9=BB=84=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄雄 <3218770186@qq.com> --- "30\351\273\204\351\233\204/11.18/boom.html" | 39 +++++++++++++++ "30\351\273\204\351\233\204/11.18/zy.md" | 52 ++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 "30\351\273\204\351\233\204/11.18/boom.html" create mode 100644 "30\351\273\204\351\233\204/11.18/zy.md" diff --git "a/30\351\273\204\351\233\204/11.18/boom.html" "b/30\351\273\204\351\233\204/11.18/boom.html" new file mode 100644 index 0000000..ed54007 --- /dev/null +++ "b/30\351\273\204\351\233\204/11.18/boom.html" @@ -0,0 +1,39 @@ + + + + + + + Document + + + + +
+
+ + + \ No newline at end of file diff --git "a/30\351\273\204\351\233\204/11.18/zy.md" "b/30\351\273\204\351\233\204/11.18/zy.md" new file mode 100644 index 0000000..3d5375d --- /dev/null +++ "b/30\351\273\204\351\233\204/11.18/zy.md" @@ -0,0 +1,52 @@ +元素(elements) + +查看body中有几个元素节点: + +``` +console.log(document.body.childElementCount); +console.log(document.body.children); +``` + +查看子节点: + +``` +console.log(document.body.firstChild);//所有节点中的第一个节点 +console.log(document.body.firstElementChild);//找第一个元素节点 +``` + +查看节点方法: + +``` +//查看父节点: +console.log(document.body.children[0].parentElement); +//查看上一个节点: +console.log(document.body.children[1].previousElementSibling); +//查看下一个节点: +console.log(document.body.children[1].nextElementSibling); +DOM节点方法: + +``` +//1.根据class获取元素: 返回: HTMLCollection (数组) +console.log(document.getElementsByClassName('H2')); + +//2.根据name属性获取元素对象: NodeList(伪数组):只能获取下标和长度 +console.log(document.getElementsByName('username')); + +//3.根据标签名获取元素对象:返回 HTMLCollection +console.log(document.getElementsByTagName('input')); + +//4.根据id属性获取元素对象,返回当前元素对象 +console.log(document.getElementById('thirdH2')); +``` +添加子元素节点 + // div.appendChild(newH2); + +删除子节点:removeChild(元素对象:h2) + // var h2 = document.getElementById('h2'); + // div.removeChild(h2); + +改:replaceChild + // div.replaceChild(newH3,h2); + +在...之前插入一个节点 + div.insertBefore(newH3,h2); \ No newline at end of file -- Gitee