title: How to get value from input field with Javascript?
body: <p>How can I get the value of an specific input field with Javascript?</p>
  
  <p>Lets take this shopify shop for example: <a href="https://geekymate.com/products/magic-doormat-1?variant=18941211607138" rel="nofollow noreferrer">https://geekymate.com/products/magic-doormat-1?variant=18941211607138</a> </p>
  
  <p>I am trying to create a script which is automatically applying an discount code based on the quantity filled in the quantity field. </p>
  
  <p>But to do that I need to be able to get the latest value of the field. 
  How would the code look like to get the latest/current value?</p>
  
  <p>EDIT: Thank you for the hint with the question. I do know that I need to use getElementById ( For the linked page above it would be this: var x = document.getElementById("Quanity").value; ) but how do I always get the latest input automatically if the enduser is changing the value?</p>