-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathexercise2-greeting.html
More file actions
34 lines (30 loc) · 1002 Bytes
/
exercise2-greeting.html
File metadata and controls
34 lines (30 loc) · 1002 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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/jsx">
/**
* EXERCISE
*
* Greeter
* ------------------------
* Requirements:
* - Create a text input box with the label 'Name'
* - When something has been entered into the text box a div should display:
* "Welcome to React, [contents of the text box]"
* - When the text box is empty, the div should be empty (i.e. it shouldn't display 'Welcome to React,'.
*/
var Greeter = React.createClass({
});
ReactDOM.render(
<Greeter/>,
document.getElementById('root')
);
</script>
</body>
</html>