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' } - }; + }