Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="UTF-8">
- <title>Testowanie sprawzdanka</title>
- <script>
- function haselko() {
- var haslo = document.getElementById("haslo").value
- var wynik = document.getElementById("napis")
- var dl = haslo.length
- // Dobre >1 cyfry dl > 7
- // Srednie 1 cyfra
- if (dl > 6 && haslo.toLowerCase().substr(dl - 2, 2) == "ów") {
- // if (dl > 6 && haslo.endsWith("ów")) {
- wynik.textContent = "Prawidlowe"
- } else {
- wynik.textContent = "NIE PRAWIDLOWE"
- }
- }
- </script>
- </head>
- <body>
- <input id="haslo" type="text">
- <input onclick="haselko()" type="submit" value="SPRAWDZ">
- <div id="napis"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement