<html> <head> <title> </title> <script> window.onload = function() { document.getElementById('btnone').addEventListener('click', function(){ document.getElementById('textBox').value = document.getElementById('textBox').value + document.getElementById('btnone').value; }); document.getElementById('btntwo').addEventListener('click', function(){ document.getElementById('textBox').value = document.getElementById('textBox').value + document.getElementById('btntwo').value; }); document.getElementById('btnthree').addEventListener('click', function(){ document.getElementById('textBox').value = document.getElementById('textBox').value + document.getElementById('btnthree').value; }); document.getElementById('btnfour').addEventListener('click', function(){ document.getElementById('textBox').value = document.getElementById('textBox').value + document.getElementById('btnfour').value; }); document.getElementById('btnadd').addEventListener('click', function(){ document.getElementById('textBox').value = document.getElementById('textBox').value + document.getElementById('btnadd').value; }); } </script> </head> <body> <input type="button" name="btnone" id="btnone" value="1" onclick="setText1()" /> <input type="button" name="btntwo" id="btntwo" value="2" onclick="setText2()" /> <input type="button" name="btnthree" id="btnthree" value="3" onclick="setText3()" /> <input type="button" name="btnfour" id="btnfour" value="4" onclick="setText4()" /> <br/> <input type="button" name="btnadd" id="btnadd" value="+" onclick="setText+()" /> <input type="button" name="btneql" id="btneql" value="=" onclick="setText=()" /> <input type="text" name="textBox" id="textBox" value=""/> </body> </html>
$('#textBox').val();
#
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)