-
Notifications
You must be signed in to change notification settings - Fork 0
/
test7.html
34 lines (33 loc) · 1.02 KB
/
test7.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
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="root"></div>
<script src="./build/react.js"></script>
<script src="./build/react-dom.js"></script>
<script src="./build/browser.min.js"></script>
<script type="text/babel">
let MyComponent = React.createClass({
handleClick: function () {
this.refs.myTextInput.focus();
},
render: function () {
return (
<div>
<input type="text" ref="myTextInput" />,
<input type="button" value="Focus this text input" onClick={this.handleClick} />
</div>
)
}
})
ReactDOM.render(
<MyComponent />,
document.getElementById('root')
)
</script>
</body>
</html>