1var MySelect = React.createClass({
2 getInitialState: function() {
3 return {
4 value: 'select'
5 }
6 },
7 change: function(event){
8 this.setState({value: event.target.value});
9 },
10 render: function(){
11 return(
12 <div>
13 <select id="lang" onChange={this.change} value={this.state.value}>
14 <option value="select">Select</option>
15 <option value="Java">Java</option>
16 <option value="C++">C++</option>
17 </select>
18 <p></p>
19 <p>{this.state.value}</p>
20 </div>
21 );
22 }
23});
24
25React.render(<MySelect />, document.body);
26