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></title>
- <script>
- function hasslo()
- {
- var haslo=document.getElementById("haslo").value;
- var d=(haslo).length;
- if(haslo=="")
- {
- document.getElementById("napis").innerHTML='<span style="color:red">HASŁO JEST PUSTE </span>';
- }
- else
- {
- var a=0;
- for (i=0; i<d;i++)
- {
- if (isNaN(haslo.charAt(i))==false)
- a+=1;
- }
- if(d>6 && haslo.endsWith("ówka"))
- {
- document.getElementById("napis").innerHTML='<span style="color:green">HASŁO SPEŁNIA WYMAGANIA! </span>';
- }
- else
- {
- document.getElementById("napis").innerHTML='<span style="color:red">HASŁO NIE SPEŁNIA WYMAGAŃ! </span>';
- }
- }
- }
- </script>
- </head>
- <body>
- <input id="haslo" type="text">
- <input onclick="hasslo()" type="button" value="Sprawdz">
- <div id="napis"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement