Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Kalkulator</title>
- <meta charset="UTF-8">
- <script language="javascript">
- <!--
- function dodaj(){
- if (document.getElementById("pierwsza").value=="") {
- alert("Wpisz wartość pierwszej liczby");
- return; }
- if (document.getElementById("druga").value=="") {
- alert("Wpisz wartość drugiej liczby");
- return; }
- var wynik=
- parseFloat(document.getElementById("pierwsza").value)
- +
- parseFloat(document.getElementById("druga").value);
- document.getElementById("wynik").value = wynik;
- return;
- }
- -->
- </script>
- </head>
- <body>
- <form>
- <input type="text" id="pierwsza" value=""></input>
- <input type="text" id="druga" value="">
- <input type="button" id="guzik" name="guzik" value="+" value="Dodaj" onclick="dodaj()">
- <input type="button" id="guzik" name="guzik" value="-" value="Odejmij" onclick="odejmij()">
- <input type="button" id="guzik" name="guzik" value="*" value="Powiel" onclick="powiel()">
- <input type="text" id="wynik" value=""></input>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement