-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
51 lines (47 loc) · 1.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="cup.js"></script>
<script type="text/javascript">
function foo () {
cup.obj.parent(this)
}
foo.prototype = {
check: {
input: function(){
var that = this._parent
console.log(that)
},
checkbox: function () {
console.log(this._parent)
},
server: {
haha: function() {
console.log(this._parent)
console.log(this._parent._parent)
}
}
}
}
var f = new foo()
f.check.input()
f.check.server.haha()
</script>
</head>
<body>
<input type="text" value="test" id="txt" />
<button type="button" id="btn">click me</button>
<script type="text/javascript">
var btn = document.getElementById('btn');
btn.addEventListener('click', function (e) {
var text = document.getElementById('txt').value;
console.log(e)
var board = e.clipboardData;
console.log(board);
board.setData('text/plain', text);
})
</script>
</body>
</html>