Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <script type="text/javascript">
- function sprawdz()
- {
- var liczba=document.getElementById("pole1").value;
- if (liczba != "" && isNaN(liczba) == false)
- {
- if(liczba>0)
- {
- document.getElementById("wynik").innerHTML="dodatnia";
- }
- else if(liczba<0)
- {
- document.getElementById("wynik").innerHTML="ujemna";
- }
- else if(liczba==0)
- {
- document.getElementById("wynik").innerHTML="zero";
- }
- }
- else
- {
- document.getElementById("wynik").innerHTML="Błąd";
- }
- }
- </script>
- </head>
- <body>
- <div id="wynik">
- <input type="text" id="pole1">
- </br>
- <input type="Submit" value="Sprawdź" onclick="sprawdz()">
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement