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>haslo</title>
- </head>
- <body>
- Twoje hasło:
- <input type="text" id="pole"/><br>
- <input type="button" id="btn" value="Sprawdź"/><br>
- <p id="wynik"></p>
- <script>
- var zbtn,zwynik,zliczba,zpole,n;
- window.onload=function () {
- zliczba = document.getElementById("pole").value;
- zbtn = document.getElementById("btn");
- zwynik = document.getElementById("wynik");
- zbtn.onclick=function (){
- ///*
- n=zliczba.length;
- for(i=0;i<n;i++){
- if(zliczba.charAt(i)>="0" && zliczba.charAt<="9")
- break;
- if(zliczba.length==0) {
- zwynik.innerText="Wpisz hasło";
- }
- else
- if(zliczba.length>7) {
- zwynik.innerText="Dobre";
- }
- else
- if((zliczba.length<6) && (zliczba.length>4)) {
- zwynik.innerText="Średnie";
- }
- else
- zwynik.innerText="Słabe";
- //*/
- }
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement