Advertisement
Guest User

Untitled

a guest
May 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang='cs'>
  3.   <head>
  4.     <title></title>
  5.     <meta charset='utf-8'>
  6.     <meta name='description' content=''>
  7.     <meta name='keywords' content=''>
  8.     <meta name='author' content=''>
  9.     <meta name='robots' content='all'>
  10.     <!-- <meta http-equiv='X-UA-Compatible' content='IE=edge'> -->
  11.     <link href='/favicon.png' rel='shortcut icon' type='image/png'>
  12.     <script>
  13.   function Oblicz() {
  14.     var liczba1 = parseInt(document.forms["form1"].liczba1.value);
  15.     var liczba2 = parseInt(document.forms["form1"].liczba2.value);
  16.     var liczba3 = parseInt(document.forms["form1"].liczba3.value);
  17.     var policzone = (liczba1 * liczba2 * liczba3);
  18.     var niepoliczone = "Blad!";
  19.     document.getElementById("wynik").innerHTML = policzone;
  20.    
  21.     if (liczba1 <= 0 || liczba2 <= 0 || liczba3 <= 0)
  22.     document.getElementById("wynik").innerHTML = niepoliczone;
  23.      
  24.    
  25.   }
  26.   </script>
  27.   </head>
  28.   <body>
  29.   <form id="form1" name="form1">
  30.   Podaj a: <input type="text" name="liczba1" /></p>
  31.   Podaj b: <input type="text" name="liczba2" /></p>
  32.   Podaj c: <input type="text" name="liczba3" /></p>
  33.  
  34.   <button onclick="Oblicz()">Oblicz</button> <button type="reset">Wyczysc</button>
  35.   </form>
  36.   <div id="wynik"></div>
  37.  
  38.   </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement