Advertisement
Guest User

Hubercik

a guest
Nov 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5. <title>title</title>
  6. <meta charset="UTF-8">
  7. </head>
  8.  
  9. <body>
  10. <form>
  11. <input type="text" id="x">
  12. <input type="number" id="y">
  13. <input type="checkbox" id="chb1" value="Dziala"/>
  14. <input type="button" value="sprCheck" onClick='s()'>
  15. <input type="button" onClick="f()" value="Oblicz">
  16. </form>
  17. <p id='w'></p>
  18. <h1 id="w1"></h1>
  19. <script>
  20.  
  21. function f(){
  22. var xx = document.getElementById("x");
  23. x=xx.value;
  24.  
  25. x=parseInt(x);
  26. var yy = document.getElementById("y");
  27. y=yy.value;
  28. y=parseInt(y);
  29. document.getElementById("w1").innerHTML= "Wynik="+(x+y);
  30. }
  31.  
  32. function s()
  33. {
  34. chb1 = document.getElementById('chb1');
  35. if (chb1.checked){
  36. document.getElementById('w').innerHTML=chb1.value;}
  37.  
  38. else
  39. { document.getElementById('w').innerHTML='Nie zaznaczono';}
  40. }
  41.  
  42.  
  43. </script>
  44.  
  45. </body>
  46.  
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement