<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Program</title>
<style>
input {
margin: 5px;
}
#wynik {
margin-top: 20px;
padding: 10px;
text-align: center;
font-size: 40px;
}
</style>
</head>
<body>
<input type="password" id="haslo" placeholder='podaj haslo'><br>
<input type="number" id="number1" placeholder='podaj liczbę'><br>
<input type="submit" value='Sprawdź' onclick="testuj()"><br>
<div id="wynik" style='border: solid 1px black; width: 400px; height: 60px;'>
</div>
<script>
function testuj(){
document.getElementById('haslo').style.border='';
document.getElementById('haslo').style.boxShadow='';
var haslo=document.getElementById('haslo').value;
if(haslo=='admin'){
var liczba=document.getElementById('number1').value;
if(liczba<0){
document.getElementById('wynik').innerHTML='Liczba ujemna';
alert('Liczba ujemna');
}
else if(liczba==0){
document.getElementById('wynik').innerHTML='Liczba wynosi 0';
alert('Liczba wynosi 0');
}
else if(liczba>0){
document.getElementById('wynik').innerHTML='Liczba dodatnia';
alert('Liczba dodatnia');
}
}
else {
document.getElementById('wynik').innerHTML='Niepoprawne hasło';
document.getElementById('haslo').style='border: solid 2px red; box-shadow: 0px 0px 10px red;';
<!--window.location.replace("http://zsp5.krosno.pl");
<!--setTimeout("location.href='http://zsp5.krosno.pl';", 5000);
}
}
</script>
</body>
</html>
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}