Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Miernik jakości hasła</title>
- <link rel="stylesheet" type="text/css" href="styl.css">
- </head>
- <body>
- <div id="pudlo">
- <div id="baner"><a href="index.html">Sprawdź swoje hasło</a>
- </div>
- <div id="lewy"><h2>Wybierz</h2>
- <ol>
- <li><a href="haslo.html">Sprawdź hasło</a></li>
- <li><a href="zasady.html">Zasady tworzenia hasła</a></li>
- </ol>
- </div>
- <div id="srodek">
- <br />
- <br />
- <form>
- <p>Twoje hasło:
- <input type="password" id="pole"/>
- <input type="button" value="Sprawdź" onclick="sprawdz()"/></p>
- </form>
- <p id="w1"></p>
- <script>
- function sprawdz() {
- var liczba = document.getElementById("pole").value;
- if(liczba.length==0) {
- w1.innerHTML="Wpisz hasło";
- w1.style.color="red"
- document.getElementById("wynik");
- }
- else if(liczba.length>=7 && liczba.search("[0-9]")>=0) {
- w1.style.color="green"
- w1.innerHTML="Mocne";
- document.getElementById("wynik");
- }
- else if((liczba.length<=6) && (liczba.length>=4) && (liczba.search("[0-9]")>=0)) {
- w1.style.color="blue"
- w1.innerHTML="Średnie"
- document.getElementById("wynik");
- }
- else if(liczba.length<4 && liczba.length>0) {
- w1.style.color="yellow"
- w1.innerHTML="Słabe";
- document.getElementById("wynik")
- }
- }
- </script>
- <div id="wynik"></div>
- </div>
- </div>
- <div id="stopka">
- <h3>Miernik jakości hasła</h3><br /> Stronę opracował: 99040107491
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement