We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8023ed commit c9e6c9bCopy full SHA for c9e6c9b
question/bind_demo
@@ -0,0 +1,25 @@
1
+<!doctype html>
2
+<html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="Generator" content="EditPlus®">
6
+ <meta name="Author" content="">
7
+ <meta name="Keywords" content="">
8
+ <meta name="Description" content="">
9
+ <title>Document</title>
10
+ </head>
11
+ <body>
12
+ <input type="button" id="button" />
13
+
14
+ <input type="text" id="text" value="bind的使用"/>
15
+ <script type="text/javascript">
16
+ <!--
17
+ var button = document.getElementById("button"),
18
+ text = document.getElementById("text");
19
+ button.onclick = function() {
20
+ alert("id:"+this.id+" \nvalue:"+this.value); // 弹出text
21
+ }.bind(text);
22
+ //-->
23
+ </script>
24
+ </body>
25
+</html>
0 commit comments