Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html lang="pl">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>haslo</title>
  6. </head>
  7. <body>
  8. Twoje hasło:
  9. <input type="text" id="pole"/><br>
  10. <input type="button" id="btn" value="Sprawdź"/><br>
  11. <p id="wynik"></p>
  12. <script>
  13. var zbtn,zwynik,zliczba,zpole,n;
  14. window.onload=function () {
  15. zliczba = document.getElementById("pole").value;
  16. zbtn = document.getElementById("btn");
  17. zwynik = document.getElementById("wynik");
  18. zbtn.onclick=function (){
  19. ///*
  20.  
  21. n=zliczba.length;
  22. for(i=0;i<n;i++){
  23. if(zliczba.charAt(i)>="0" && zliczba.charAt<="9")
  24. break;
  25.  
  26.  
  27. if(zliczba.length==0) {
  28. zwynik.innerText="Wpisz hasło";
  29. }
  30. else
  31. if(zliczba.length>7) {
  32.  
  33. zwynik.innerText="Dobre";
  34. }
  35. else
  36. if((zliczba.length<6) && (zliczba.length>4)) {
  37. zwynik.innerText="Średnie";
  38. }
  39. else
  40. zwynik.innerText="Słabe";
  41. //*/
  42. }
  43. }
  44. }
  45. </script>
  46.  
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement