Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.00 KB | None | 0 0
  1. Skrypt by omega (znajomy programista): <script>
  2.     var passwordManager = {
  3.                
  4.     checkPasswordStrength: function(){
  5.         var password = document.getElementById("password").value;
  6.        
  7.         if(password.length > 6 && this.checkIfStringContainsNumbers(password)){
  8.            this.setPasswordStrength("Hasło jest silne", "green")
  9.        }else if(password.length > 6){
  10.            this.setPasswordStrength("Hasło jest średnie", "blue");
  11.         }else if(password.length >= 4 && password.length <= 6){
  12.            this.setPasswordStrength("Hasło jest słabe", "yellow");
  13.         }else if(password.length === 0){
  14.             this.setPasswordStrength("Hasło jest puste", "red");
  15.         }
  16.     },
  17.    
  18.     setPasswordStrength: function(text, color){
  19.         document.getElementById("result").innerHTML = text.fontcolor(color);
  20.     },
  21.    
  22.     checkIfStringContainsNumbers: function(str){
  23.         var regex = /\d/g;
  24.         return regex.test(t);
  25.     }
  26.     }
  27.    
  28.     </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement