title: How to get input text value on click in ReactJS
body: <p>I am learning ReactJS and I want to understand how to get the input text values in ReactJS using simple onclick event. I have followed there tutorial and although i am able to get the parameter of text input. But somehow i am not able to get its value. 
  I know this is a dumb question, but i am struggling with this. 
  Please check my code and let me know what's wrong with it.</p>
  
  <pre><code>var MyComponent = React.createClass({
    handleClick: function() {
      if (this.refs.myInput !== null) {
          var input = this.refs.myInput;
              var inputValue = input.value;
        alert("Input is", inputValue);
      }
    },
    render: function() {
      return (
        &lt;div&gt;
          &lt;input type="text" ref="myInput" /&gt;
          &lt;input
            type="button"
            value="Alert the text input"
            onClick={this.handleClick}
          /&gt;
        &lt;/div&gt;
      );
    }
  });
  
  ReactDOM.render(
    &lt;MyComponent /&gt;,
    document.getElementById('container')
  );
  </code></pre>
  
  <p>Here is jsfiddle for the same : <a href="https://jsfiddle.net/69z2wepo/49490/" rel="noreferrer">jsfiddle link</a></p>