function setValue(val) { document.getElementById("fieldName").value=val; }
<input id="fieldName" type="text" value="10" /> <input type="button" value="change value" onclick="setValue(15)" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)