Password Quality Evaluator

This is an up-and-coming feature on some sites. It measures the quality of a password, and gives the user immediate feedback about how good it is. The JavaScript below does that. It calculates the score by grouping the keyboard into uppercase, lowercase, punctuation, and numbers. You get points for length, for diversity in using keys from different groups, for switching groups often, and extra for using punctuation. The HTML part was intended for creating an .htaccess password. Here's a demo: