-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e37540b
commit 5f18f09
Showing
8 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>后盾人</title> | ||
</head> | ||
<body> | ||
<!-- 后盾人 --> | ||
<div id="hd"></div> | ||
<h2>houdunren.com</h2> | ||
<script> | ||
let obj = {} | ||
//DOM document object model | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<h2 id="hd">hdcms.com</h2> | ||
<h3 class="hd"></h3> | ||
<h4></h4> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>hdcms.com</th> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</body> | ||
<script> | ||
console.log('后盾人') | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>后盾人</title> | ||
</head> | ||
<body> | ||
<script> | ||
// setTimeout(() => { | ||
// let hd = document.getElementById('hd') | ||
// console.log(hd) | ||
// }) | ||
</script> | ||
<script src="3.js" defer></script> | ||
<div id="hd"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
let hd = document.getElementById('hd') | ||
console.log(hd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>后盾人</title> | ||
</head> | ||
<body class="red"> | ||
<!-- houdunren.com --> | ||
<!-- <script> | ||
console.log(document.nodeType) | ||
console.log(document.body.nodeType) | ||
console.log(document.body.attributes[0].nodeType) | ||
console.log(document.body.childNodes[0].nodeType) | ||
console.log(document.body.childNodes[1].nodeType) | ||
</script> --> | ||
<div id="hd">hdcms.com</div> | ||
<input type="text" id="title" /> | ||
<script> | ||
// console.dir(hd) | ||
function prototype(el) { | ||
let p = Object.getPrototypeOf(el) | ||
console.log(p) | ||
Object.getPrototypeOf(p) ? prototype(p) : '' | ||
} | ||
let hd = document.getElementById('title') | ||
prototype(hd) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>后盾人</title> | ||
</head> | ||
<body> | ||
<div id="hd">houdunren.com</div> | ||
<script> | ||
let hd = document.getElementById('hd') | ||
Object.assign(hd, { | ||
id: 'red', | ||
onclick() { | ||
Object.assign(this.style, { | ||
backgroundColor: hd.id, | ||
}) | ||
}, | ||
}) | ||
// Object.assign(hd, { | ||
// color: 'red', | ||
// change() { | ||
// this.innerHTML = '后盾人' | ||
// this.style.color = this.color | ||
// }, | ||
// onclick() { | ||
// this.change() | ||
// }, | ||
// }) | ||
// hd.title = '后盾人' | ||
// hd.id = 'houdunren' | ||
// hd.style.color = 'red' | ||
// hd.name = '后盾人' | ||
// hd.show = function () { | ||
// console.log(this.name) | ||
// } | ||
// hd.show() | ||
// let hd = {} | ||
// hd.name = '后盾人' | ||
// hd.show = function () { | ||
// console.log(this.name) | ||
// } | ||
// hd.show() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>后盾人</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<div class="houdunren" data="hd">houdunren.com</div> | ||
<div class="hdcms">hdcms.com</div> | ||
<div class="xiangjun"><!-- 向军大叔 --></div> | ||
</div> | ||
<script> | ||
let app = document.getElementById('app') | ||
console.log(app.nodeType) | ||
|
||
console.log(app.firstChild.nodeType) | ||
|
||
console.log(app.childNodes[1].attributes[0].nodeType) | ||
|
||
const xj = document.querySelector('.xiangjun') | ||
console.log(xj.firstChild.nodeType) | ||
|
||
console.dir(app) | ||
|
||
console.log(app instanceof HTMLDivElement) | ||
|
||
console.log(app instanceof Element) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>后盾人</title> | ||
</head> | ||
<body> | ||
<div id="hd"> | ||
<h1>houdunren.com</h1> | ||
<ul> | ||
<li> | ||
<h2> | ||
<span>后盾人</span> | ||
</h2> | ||
</li> | ||
</ul> | ||
</div> | ||
<script> | ||
function all(el) { | ||
const items = [] | ||
;[...el.childNodes].map((node) => { | ||
if (node.nodeType == 1) { | ||
items.push(node, ...all(node)) | ||
} | ||
}) | ||
return items | ||
} | ||
const nodes = all(document.getElementById('hd')) | ||
console.log(nodes) | ||
</script> | ||
</body> | ||
</html> |