title: To get value of user input from input
body: <p>I am learning Javascript and trying to get user input value from input.</p>
  
  <p>In my project, I have an input form, and when they add new number and click a button, and new form will appear, and user can put another number, and new input field will continue appearing as long as user clicks button.</p>
  
  <p>What I want is to get value from each input. 
  I saw some questions asking similar question, but .document.getElementsByName() didn't work for me. </p>
  
  <pre><code>let userInput = document.getElementsByName('moneyamount');
  inputNum = parseInt(userInput.value);
  
  console.log(inputNum); //result is NaN
  </code></pre>
  
  <p>I also tried document.querySelector()</p>
  
  <pre><code>let userInput = document.querySelector('#money-amount');
  inputNum = parseInt(userInput.value);
  
  console.log(inputNum) 
  </code></pre>
  
  <p>which worked perfect, but I need to get value from a few inputs, so querySelector will not be good for this situation. 
  so I tried document.querySelectorAll() as well, however, </p>
  
  <pre><code>let userInput = document.querySelectorAll('#money-amount');
  inputNum = parseInt(userInput.value)
  
  console.log(inputNum)// result is NaN
  </code></pre>
  
  <p>I am not sure what DOM I should use in this situation.
  I need to select all elements and need to get value from them. </p>
  
  <p>This is my HTML of input. There is only one input at this moment, because when user clicks add button, new form will be added.</p>
  
  <pre><code>          &lt;input
              class="input money"
              type="number"
              id="money-amount"
              placeholder="Enter amount"
              name="moneyamount"
              required
            /&gt;
  
        &lt;/div&gt;
  </code></pre>
  
  <p>I hope you guys could help this problem.</p>
  
  <p>Thank you so much!</p>