Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Miernik jakości hasła</title>
  6. <link rel="stylesheet" type="text/css" href="styl.css">
  7.  
  8. </head>
  9.  
  10. <body>
  11.  
  12. <div id="pudlo">
  13. <div id="baner"><a href="index.html">Sprawdź swoje hasło</a>
  14. </div>
  15. <div id="lewy"><h2>Wybierz</h2>
  16. <ol>
  17. <li><a href="haslo.html">Sprawdź hasło</a></li>
  18. <li><a href="zasady.html">Zasady tworzenia hasła</a></li>
  19. </ol>
  20. </div>
  21. <div id="srodek">
  22. <br />
  23. <br />
  24.  
  25. <form>
  26. <p>Twoje hasło:
  27. <input type="password" id="pole"/>
  28. <input type="button" value="Sprawdź" onclick="sprawdz()"/></p>
  29. </form>
  30. <p id="w1"></p>
  31. <script>
  32.  
  33. function sprawdz() {
  34. var liczba = document.getElementById("pole").value;
  35.  
  36. if(liczba.length==0) {
  37. w1.innerHTML="Wpisz hasło";
  38. w1.style.color="red"
  39.  
  40. document.getElementById("wynik");
  41. }
  42. else if(liczba.length>=7 && liczba.search("[0-9]")>=0) {
  43. w1.style.color="green"
  44. w1.innerHTML="Mocne";
  45. document.getElementById("wynik");
  46. }
  47. else if((liczba.length<=6) && (liczba.length>=4) && (liczba.search("[0-9]")>=0)) {
  48. w1.style.color="blue"
  49. w1.innerHTML="Średnie"
  50. document.getElementById("wynik");
  51. }
  52.  
  53. else if(liczba.length<4 && liczba.length>0) {
  54. w1.style.color="yellow"
  55. w1.innerHTML="Słabe";
  56. document.getElementById("wynik")
  57.  
  58. }
  59.  
  60. }
  61.  
  62. </script>
  63.  
  64. <div id="wynik"></div>
  65. </div>
  66. </div>
  67. <div id="stopka">
  68. <h3>Miernik jakości hasła</h3><br /> Stronę opracował: 99040107491
  69. </div>
  70. </div>
  71.  
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement