Skip to content

Commit 27ac18a

Browse files
committed
xiugai
1 parent 9292968 commit 27ac18a

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎app/test.html‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Test</title>
6+
<script type="text/javascript" src="../js/example.js" ></script>
7+
</head>
8+
<body>
9+
<div id="testdiv">
10+
</div>
11+
</body>
12+
</html>

‎js/example.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Created by M.Jin on 14-7-1.
3+
*/
4+
window.onload = function(){
5+
var testdiv = document.getElementById("testdiv");
6+
var para = document.createElement("p");
7+
var txt1 = document.createTextNode("This is");
8+
var elph = document.createElement("em");
9+
var txt2 = document.createTextNode("my");
10+
var txt3 = document.createTextNode("content.");
11+
12+
elph.appendChild(txt2);
13+
para.appendChild(txt1);
14+
para.appendChild(elph);
15+
para.appendChild(txt3);
16+
17+
testdiv.appendChild(para);
18+
}

0 commit comments

Comments
 (0)