title: React/Next.js how to get other Element event target value on button click
body: <p>I have an input element and a button in React:</p>
  
  <pre><code>      &lt;li&gt;&lt;input type="text" placeholder="Enter new ID"&gt;&lt;/input&gt;
        &lt;button onClick={(e)=&gt;this.saveKonfigElementHandler()}&gt;Save&lt;/button&gt;&lt;/li&gt;  
  </code></pre>
  
  <p>Now, when I enter some value into the input field, I want to save the value into some array when I click on the button. 
  Is it somehow possible to get a reference to that input field (e.g. the target.value of the input field) to save it when clicking the button?</p>
  
  <p>Or would I simply have to do it with an onChange event that saves the current input value into some Variable, and when I click the button, I will simply retrieve that value to save it into some array? Maybe that would be a lot simpler.    </p>
  
  <p>E.g:</p>
  
  <pre><code>&lt;input type="text" value={this.state.inputFieldText.join('')} onChange={(event) =&gt; this.textHandler(event)}&gt;&lt;/input&gt;
  </code></pre>
  
  <p>in the textHandler Method, I will save the target value from the input field into a Class Component state variable in the textHandler() method. And when I click the button, I retrieve that state value and can do some manipulation with it?</p>