This is very strange to me:
document.getElementById('orderNumber')
returns
<button class="popup" id="orderNumber">order Number</button>
document.getElementById('orderNumber').value
returns ”
all the operation is after dom fully loaded and after I input the type,
If you want the
valueof the element, that element has to have avalueattribute set:The value being retrieved by:
or if you want the text of the element, try retrieving the
textContent(orinnerText):A general JS Fiddle proof of concept.