Skip to content

Commit

Permalink
Create bind_demo
Browse files Browse the repository at this point in the history
bind的方法使用
  • Loading branch information
wchaowu committed Dec 6, 2015
1 parent b8023ed commit c9e6c9b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions question/bind_demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
<input type="button" id="button" />

<input type="text" id="text" value="bind的使用"/>
<script type="text/javascript">
<!--
var button = document.getElementById("button"),
text = document.getElementById("text");
button.onclick = function() {
alert("id:"+this.id+" \nvalue:"+this.value); // 弹出text
}.bind(text);
//-->
</script>
</body>
</html>

0 comments on commit c9e6c9b

Please sign in to comment.