From 5e62a7cb8feb0f11c4372363095cfb731fc3f37a Mon Sep 17 00:00:00 2001 From: aBin Date: Tue, 27 Jul 2021 17:22:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AF=8A=E5=86=85=E7=BD=AE=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 1f16713..3968d7a 100644 --- a/index.html +++ b/index.html @@ -47,9 +47,12 @@ -
-
- +
+
+
+
+ +
@@ -60,11 +63,19 @@ alert(this.name) } } - const p102 = { - jumpDetails() { + ;(function() { + var dom = document.querySelector('div[data-root=p103]') + var domBox = dom.parentNode; + var domChild = document.querySelectorAll('div[data-root=p103]>div'); + domChild[0].innerHTML = domBox.getAttribute('data-tname'); + })() + const p103 = { + jumpDetails(that) { + console.log(that.parentNode.getAttribute('data-tname')) + console.log(that.parentNode.getAttribute('data-pid')) location.href = 'https://www.baidu.com' } - }; + }