I want to create a function to change the value of targeting textbox but I can't figure out what's wrong with my code.
<form name="formcalc">
<input type="text" value="1" name="A" >
<input type="button" value="Change" onClick="change(A)">
<br>
<input type="text" value="2" name="B" >
<input type="button" value="Change" onClick="change(B)">
</form>
<script>
function change(x) {
document.formcalc.x.value = 3;
}
</script>