Advertisement
Guest User

Untitled

a guest
Nov 13th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  3.  
  4. <title>Untitled Document</title>
  5. <script type="text/javascript">
  6. function init() {
  7.     var snabel = document.getElementById("snabel");
  8.     if (snabel !=null) {
  9.         var html = "";
  10.         for (i=1; i<=12; i++) {
  11.             html += '<input type="button" value="-5" onclick="var o=document.getElementById(\'snabel'+i+'\'); o.value = parseInt(o.value) + parseInt(this.value);">';
  12.             html += '<input type="button" value="-3" onclick="var o=document.getElementById(\'snabel'+i+'\'); o.value = parseInt(o.value) + parseInt(this.value);">';
  13.             html += '<input type="button" value="-1" onclick="var o=document.getElementById(\'snabel'+i+'\'); o.value = parseInt(o.value) + parseInt(this.value);">';
  14.             html += '<input name="" type="text" value="0" size="5" id="snabel'+i+'" readonly="true">';
  15.             html += '<input type="button" value="+1" onclick="var o=document.getElementById(\'snabel'+i+'\'); o.value = parseInt(o.value) + parseInt(this.value);">';
  16.             html += '<input type="button" value="+3" onclick="var o=document.getElementById(\'snabel'+i+'\'); o.value = parseInt(o.value) + parseInt(this.value);">';
  17.             html += '<input type="button" value="+5" onclick="var o=document.getElementById(\'snabel'+i+'\'); o.value = parseInt(o.value) + parseInt(this.value);">';
  18.             html += '<br />';
  19.    
  20.         }
  21.         snabel.innerHTML = html;
  22.     }
  23. }
  24. </script>
  25.  
  26. </head>
  27.  
  28. <body onload="init();">
  29. <center id="snabel">
  30. </center>
  31.  
  32.  
  33. </body></html>
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement