Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8" />
- </head>
- <body>
- <input type="text" id="liczba">
- <button onclick="sprawdz()">Sprawdź</button>
- <div id="wynik"></div>
- <script>
- function sprawdz() {
- var liczba = document.getElementById("liczba").value;
- var wynik = document.getElementById("wynik");
- if (isNaN(liczba)) {
- wynik.innerHTML = "To nie jest liczba!";
- } else {
- wynik.innerHTML = "To jest liczba!";
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement