tei123

pot strona

Nov 3rd, 2016
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <link rel="stylesheet" type="text/css" href="styl.css">
  5. </head>
  6. <body>
  7. <i>
  8. <div id=glow>
  9. <div id=ban>
  10. <a href="index.html" ><img src="baner.jpg" width='100%'></a>
  11. </div>
  12. <div id=men2>
  13. <br>
  14. <br>
  15. <br>
  16. <br>
  17. <br>
  18. Menu <br>
  19. <a href="proste.html">- proste działania</a>
  20. <br>
  21. <a href="pot.html">- potęgowanie</a>
  22.  
  23. </div>
  24.  
  25. <div id=pot>
  26. <script>
  27. function pot()
  28. {
  29. var a,b,c,d,e,f;
  30. a=document.getElementById("p1").value;
  31. b=document.getElementById("p2").value;
  32. b=parseInt(b);
  33. if (a=="")
  34. alert("Wpisz podstawę i wykładnik potęgi")
  35. else
  36. {
  37. if (b<0)
  38. alert("Wykładnik potęgi musi być dodatni")
  39. else
  40. a=parseInt(a);
  41.  
  42. c = Math.pow(a,b);
  43. alert(c);
  44. }
  45.  
  46. }
  47.  
  48. </script>
  49.  
  50. </head>
  51.  
  52. <body>
  53.  
  54. <center>
  55.  
  56. <h1>
  57. POTĘGOWANIE
  58. </H1>
  59. <br>
  60.  
  61. <i>
  62. Podaj podstawę potęgi
  63. <input id="p1"/>
  64. <br>
  65. Podaj dodatni, całkowity wykładnik potęgi
  66. <input id="p2"/>
  67. </i>
  68. <br>
  69.  
  70. <button onClick="pot()">POTĘGOWANIE</button>
  71.  
  72. </div>
  73.  
  74. </div>
  75.  
  76. </div>
  77. </body>
  78.  
  79. </html>
Add Comment
Please, Sign In to add comment