For example:
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="js/calkulator3.js"></script> <link href="css/calculator1.css" rel="stylesheet" type="text/css"/> <title>test</title> </head> <body> <div class="mesto"> <div id="panel1" class="panel"> </div> <div class="knopki"> <input class="botom_1" type="button" value="1" id="a1" onClick="change"> <input class="botom_2" type="button" value="2" id="a2" onclick="change()"> <input class="botom_3" type="button" value="3" id="a3" onclick="change()"> <input class="botom_4" type="button" value="4" id="a4" onclick="change()"> <input class="botom_5" type="button" value="5" id="a5" onclick="change()"> <input class="botom_6" type="button" value="6" id="a6" onclick="change()"> <input class="botom_7" type="button" value="7" id="a7" onclick="change()"> <input class="botom_8" type="button" value="8" id="a8" onclick="change()"> <input class="botom_9" type="button" value="9" id="a9" onclick="change()"> <input class="botom_0" type="button" value="0" id="a0" onclick="change()"> </div> </div> </body> </html>
In order not to create ten different functions, you can create one that will determine the id of the pressed button and pull the value out of this ID. How to do it?