Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <script>
  7. function hasslo()
  8. {
  9. var haslo=document.getElementById("haslo").value;
  10. var d=(haslo).length;
  11. if(haslo=="")
  12. {
  13. document.getElementById("napis").innerHTML='<span style="color:red">HASŁO JEST PUSTE </span>';
  14. }
  15. else
  16. {
  17. if(d>6 && haslo.endsWith("ówka"))
  18. {
  19. document.getElementById("napis").innerHTML='<span style="color:green">HASŁO SPEŁNIA WYMAGANIA! </span>';
  20. }
  21. else
  22. {
  23. document.getElementById("napis").innerHTML='<span style="color:red">HASŁO NIE SPEŁNIA WYMAGAŃ! </span>';
  24. }
  25. }
  26. }
  27. </script>
  28. </head>
  29.  
  30. <body>
  31. <input id="haslo" type="text">
  32. <input onclick="hasslo()" type="button" value="Sprawdz">
  33. </body>
  34.  
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement