title: Is Javascript synchronous when manipulating the DOM?
body: <p>I have a form with an input of type field. I have several radiobuttons, and depending on which of them I click, the value in the input type field will be updated. After that, I will call a Javascript function to perform certain action, and the function will use the updated quantity (text) in the input field.</p>
  
  <p>Of course, it is more secure to pass that quantity to the function itself, but could I rely on Javascript first updating the DOM, displaying the update input field value, and with that, retrieving it via<code>document.getElementById("input-quantity").value</code> and using this in the function? Or could the function get the "old" value if the refresh of the DOM takes its time?</p>