type html>
<html>
<head>
<title>PROSTE DZIAŁANIA</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script>
function f(x)
{
var a=parseInt(document.forms['formularz'].liczba1.value);
var b=parseInt(document.forms['formularz'].liczba2.value);
var wynik_ob=document.forms['formularz'].wynik;
var napis='';
if (isNaN(a) || isNaN(b)) napis='Proszę uzupełnić obie liczby'; else
if (x==4 && b==0) napis='Nie wolno dzielić przez zero'; else
{
var wynik;
if (x==1) wynik=a+b; else
if(x==2) wynik=a-b; else
if(x==3) wynik=a*b; else
wynik=a/b;
napis='Wynik działania: '+wynik;
}
wynik_ob.value=napis;
}
</script>
</head>
<body>
<div class="pojemnik">
<header>
<a href="index.html"><img src="baner.jpg" alt="baner"></a>
</header>
<nav>
<p><a href="strona1.html">- proste działania</a></p>
<p><a href="strona2.php">- potęgowanie</a></p>
</nav>
<article>
<h1>PROSTE DZIAŁANIA</h1>
<form name="formularz" onSubmit="return false;">
<i>Podaj pierwszą liczbę: </i><input type="number" name="liczba1" /><br /><br />
<i>Podaj drugą liczbę: <input type="number" name="liczba2" /><br /><br />
<button onClick="f(1)">DODAWANIE</button>
<button onClick="f(2)">ODEJMOWANIE</button>
<button onClick="f(3)">MNOŻENIE</button>
<button onClick="f(4)">DZIELENIE</button>
<br /><br />
<output name="wynik"></output>
</form>
</article>
</div>
</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"}