-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact_ref.html
More file actions
39 lines (32 loc) · 744 Bytes
/
react_ref.html
File metadata and controls
39 lines (32 loc) · 744 Bytes
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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/react.js"></script>
<script src="js/react-dom.js"></script>
<script src="js/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
var LoginWin = React.createClass({
handleIn:function(){
console.log(this.refs.inputV.value-this.refs.inputX.value);
},
render:function(){
return <div>
<input type="text" ref = "inputV"/>
<input type="text" ref = "inputX"/>
<input type="text" ref = "inputZ"/>
<button onClick = {this.handleIn} >登录</button>
</div>
}
})
ReactDOM.render(
<LoginWin/>,
document.getElementById('example')
)
</script>
</body>
</html>