Hi friends today i will give the html code for checking password strength....
copy and save the following code.
<script>
function findStrength(v){
len = v.length;
//alert(len);
if(len>12) len=12;
document.getElementById('pic').src = "images/"+len+".png";
if(len<6){
document.getElementById('weak').innerHTML = 'Weak Password';
document.getElementById('weak').style.color='red';
}
else if(len>=6 && len<9){
document.getElementById('weak').innerHTML = 'Normal Password';
document.getElementById('weak').style.color='green';
}
else if(len>=9 && len<=12){
document.getElementById('weak').innerHTML = 'Strong Password';
document.getElementById('weak').style.color='blue';
}
}
</script>
<body>
<form>
Enter Password : <input type='password' name='pwd' value='' onkeyup="javascript:findStrength(this.value);"/> <img src="images/0.png" border='1' id='pic'/> <span id='weak'></span>
</form>
</body> Save this code as passwordstrength.html
copy that symbols and save as 0,1,2,3,..........12 respectively into a file named as images....
then place that html file and this images in the same folder then double click on that passwordstrength.html
copy and save the following code.
<script>
function findStrength(v){
len = v.length;
//alert(len);
if(len>12) len=12;
document.getElementById('pic').src = "images/"+len+".png";
if(len<6){
document.getElementById('weak').innerHTML = 'Weak Password';
document.getElementById('weak').style.color='red';
}
else if(len>=6 && len<9){
document.getElementById('weak').innerHTML = 'Normal Password';
document.getElementById('weak').style.color='green';
}
else if(len>=9 && len<=12){
document.getElementById('weak').innerHTML = 'Strong Password';
document.getElementById('weak').style.color='blue';
}
}
</script>
<body>
<form>
Enter Password : <input type='password' name='pwd' value='' onkeyup="javascript:findStrength(this.value);"/> <img src="images/0.png" border='1' id='pic'/> <span id='weak'></span>
</form>
</body> Save this code as passwordstrength.html
copy that symbols and save as 0,1,2,3,..........12 respectively into a file named as images....
then place that html file and this images in the same folder then double click on that passwordstrength.html












