S. Miller S. Miller - 4 months ago 12
HTML Question

Why can't I display a variable in a text field?

I have a function that creates a string and I would like for it to be displayed in a textbox on the page. I cannot understand why this does not work.


<input id="poNum" type="text" name="PO" id="PO" style="width: 310px;" readonly />


document.getElementById("poNum").innerHTML = number;

 document.getElementById("poNum").value = number;

InnerHTML is accessing... well, the actual inner html. Where as value is a attribute for inputs (selects, buttons, etc).