Facebook
From Gruff Duck, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 180
  1. <!doctype html>
  2. <html>
  3.         <head>
  4.                 <meta charset="utf-8">
  5.                 <title>Program</title>
  6.                 <style>
  7.                         input {
  8.                                 margin: 5px;
  9.                         }
  10.                        
  11.                         #wynik {
  12.                                 margin-top: 20px;
  13.                                 padding: 10px;
  14.                                 text-align: center;
  15.                                 font-size: 40px;
  16.                         }
  17.                 </style>
  18.         </head>
  19.         <body>
  20.                 <input type="password" id="haslo" placeholder='podaj haslo'><br>
  21.                 <input type="number" id="number1" placeholder='podaj liczbę'><br>
  22.                 <input type="submit" value='Sprawdź' onclick="testuj()"><br>
  23.                 <div id="wynik" style='border: solid 1px black; width: 400px; height: 60px;'>
  24.                
  25.                 </div>
  26.                 <script>
  27.                         function testuj(){
  28.                                 document.getElementById('haslo').style.border='';
  29.                                 document.getElementById('haslo').style.boxShadow='';
  30.                                 var haslo=document.getElementById('haslo').value;
  31.                                 if(haslo=='admin'){
  32.                                         var liczba=document.getElementById('number1').value;
  33.                                         if(liczba<0){
  34.                                                 document.getElementById('wynik').innerHTML='Liczba ujemna';
  35.                                                 alert('Liczba ujemna');
  36.                                         }
  37.                                         else if(liczba==0){
  38.                                                 document.getElementById('wynik').innerHTML='Liczba wynosi 0';
  39.                                                 alert('Liczba wynosi 0');
  40.                                         }
  41.                                         else if(liczba>0){
  42.                                                 document.getElementById('wynik').innerHTML='Liczba dodatnia';
  43.                                                 alert('Liczba dodatnia');
  44.                                         }
  45.                                 }
  46.                                 else {
  47.                                         document.getElementById('wynik').innerHTML='Niepoprawne hasło';
  48.                                         document.getElementById('haslo').style='border: solid 2px red; box-shadow: 0px 0px 10px red;';                         
  49.                                         <!--window.location.replace("http://zsp5.krosno.pl");
  50.                                         <!--setTimeout("location.href='http://zsp5.krosno.pl';", 5000);
  51.                                 }
  52.                         }
  53.                 </script>
  54.         </body>
  55. </html>