Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <script src="//fb.me/react-0.13.1.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var MySelect = React.createClass({
  getInitialState: function() {
    return {
      value: "0"
    };
  },
  handleChange: function(event) {
    var value = event.target.value;
    console.log(value, " was selected");
    this.setState({value: event.target.value});
  },
  render: function() {
    return (
      <select value={this.state.value} onChange={this.handleChange}>
        <option value="0">Choose your option</option>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
      </select>
    );
  }
})
React.render(
  <MySelect />, document.body
);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
palcupro
0viewers