Trying to press a button which outputs text in an input field. the function is to output text "x" into input field upon press, which is set to read only. only js and html allowed. Here's what i got so far in HTML and js:
<button id="button4" onclick="output()">Hokus Pokus</button>
<input id="printoutput" readonly="true" type="text">
js:
function output() {
document.getElementById("printoutput").innerHTML = "x";
}
Why does this not work?