Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Skrypt by omega (znajomy programista): <script>
- var passwordManager = {
- checkPasswordStrength: function(){
- var password = document.getElementById("password").value;
- if(password.length > 6 && this.checkIfStringContainsNumbers(password)){
- this.setPasswordStrength("Hasło jest silne", "green")
- }else if(password.length > 6){
- this.setPasswordStrength("Hasło jest średnie", "blue");
- }else if(password.length >= 4 && password.length <= 6){
- this.setPasswordStrength("Hasło jest słabe", "yellow");
- }else if(password.length === 0){
- this.setPasswordStrength("Hasło jest puste", "red");
- }
- },
- setPasswordStrength: function(text, color){
- document.getElementById("result").innerHTML = text.fontcolor(color);
- },
- checkIfStringContainsNumbers: function(str){
- var regex = /\d/g;
- return regex.test(t);
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement