Hej Daniel! Skrev vad jag tror du är ute efter nedan: Vänligen Tobbe <!DOCTYPE html> <html> <body style="background-color:blue;"> <script> function buttonpress() { document.getElementById("summa").innerHTML=(document.getElementById("summa").innerHTML-1+2); } function buttonpress2(e) {number=e.attributes.count.value-1+1; document.getElementById("summa").innerHTML=(document.getElementById("summa").innerHTML-1+1+number); } </script> <table width="710" border="0"> <tr> <td width="60"><u>Turordning</u></td> </tr> <tr> <td><button type="button" onclick="buttonpress(this);" value="1">Knapp1</button></td><td><button type="button" onclick="buttonpress2(this);" count="1" >Knapp1</button></td> </tr> <tr> <td><button type="button" onclick="buttonpress(this);" value="2">Knapp2</button></td><td><button type="button" onclick="buttonpress2(this);" count="2" >Knapp1</button></td> </tr> <tr> <td><button type="button" onclick="buttonpress(this);" value="3">Knapp3</button></td><td><button type="button" onclick="buttonpress2(this);" count="3" >Knapp1</button></td> </tr> <tr><td id="summa">0</td></tr> </table> </body> </html> |