Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <script type="text/Javascript">
- function oblicz() {
- var x=Number(document.getElementById("liczba1").value);
- var y=Number(document.getElementById("liczba2").value);
- var z=Number(document.getElementById("wybierz").value);
- if (z=="d1") document.getElementById("wynik").innerHTML=x+y;
- if (z=="d2") document.getElementById("wynik").innerHTML=x-y;
- if (z=="d3") document.getElementById("wynik").innerHTML=x*y;
- if (z=="d4") document.getElementById("wynik").innerHTML=x/y;
- }
- </script>
- <body>
- <form method="post">
- <input type="text" id="liczba1">
- <br>
- <input type="text" id="liczba2">
- <br>
- <select id="wybierz">
- <option value="d1">+</option>
- <option value="d2">+</option>
- <option value="d3">+</option>
- <option value="d4">+</option>
- </select>
- <input type="button" value="oblicz" onClick="oblicz()">
- </form>
- </body>
- <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement