Html PasswordInput

Set the passwordStrength property of the jqxPasswordInput. Author: http://jqwidgets.com

by jqwidgets

HTML

<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<input type="password" id='input' />

JavaScript

$("#input").jqxPasswordInput({
       width: '250px',
       height: '25px',
       showStrength: true,
       passwordStrength: function (password, characters, defaultStrength) {
           var length = password.length;
           var letters = characters.letters;
           var numbers = characters.numbers;
           var specialKeys = characters.specialKeys;
           var strengthCoefficient = letters + numbers + 2 * specialKeys + letters * numbers * specialKeys;
           var strengthValue;
           if (length < 4) {
               strengthValue = "Too short";
           } else if (strengthCoefficient < 10) {
               strengthValue = "Weak";
           } else if (strengthCoefficient < 20) {
               strengthValue = "Fair";
           } else if (strengthCoefficient < 30) {
               strengthValue = "Good";
           } else {
               strengthValue = "Strong";
           };
           return strengthValue;
       }
   });