I'm trying to create a function so that when one of my buttons is pressed the value of the text input changes to the value of the button pressed.
<div id="viewer">
<h1>
<input type="text" id="Screen" maxlength="8" value="0"/>
</h1>
<h2>
<button type="button" value="1" id="1">1</button>
<button type="button" value="2" id="2">2</button>
</h2>
</div>
This is the function I am trying to use but am going wrong somewhere:
$(document).ready(function(){
$("button").click(function(){
var $val = $("#Display").val();
alert($val);
onclick="sevenClick()";
});
});
});