Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3.  
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>Testowanie sprawzdanka</title>
  7. <script>
  8. function haselko() {
  9. var haslo = document.getElementById("haslo").value
  10. var wynik = document.getElementById("napis")
  11. var dl = haslo.length
  12. // Dobre >1 cyfry dl > 7
  13. // Srednie 1 cyfra
  14.  
  15. if (dl > 6 && haslo.toLowerCase().substr(dl - 2, 2) == "ów") {
  16. // if (dl > 6 && haslo.endsWith("ów")) {
  17. wynik.textContent = "Prawidlowe"
  18. } else {
  19. wynik.textContent = "NIE PRAWIDLOWE"
  20. }
  21. }
  22.  
  23.  
  24. </script>
  25. </head>
  26.  
  27. <body>
  28. <input id="haslo" type="text">
  29. <input onclick="haselko()" type="submit" value="SPRAWDZ">
  30. <div id="napis"></div>
  31. </body>
  32.  
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement