forked from csxiaoyaojianxian/JavaScriptStudy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08-jsModule.js
More file actions
17 lines (15 loc) · 420 Bytes
/
08-jsModule.js
File metadata and controls
17 lines (15 loc) · 420 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var div = document.createElement("div");
document.body.appendChild(div);
var obj = new Time.Test(div);
var button1 = document.createElement("button");
button1.innerHTML = "start";
button1.onclick = function(){
obj.start();
}
document.body.appendChild(button1);
var button2 = document.createElement("button");
button2.innerHTML = "stop";
button2.onclick = function(){
obj.stop();
}
document.body.appendChild(button2);