Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does jQuery realize the function of password strength prompt when registering a member?

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "jQuery how to achieve password strength prompt information function when registered members", so the editor summarizes the following content to you, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "jQuery how to achieve password strength prompt information function when registered members" article.

1. The effect is shown in the figure:

2.html Code:

Set password: *

Password strength

3.jquery Code:

/ / checkStrong function / / returns the strength level of the password function checkStrong (sPW) {if (sPW.length=1;} return modes;} / / pwStrength function / / when the user releases the keyboard or the password input box loses focus, different colors are displayed according to different levels: function pwStrength (pwd) {var colors = "# eeeeee"; var colors = "# FF4040"; var colors = "# FF9900"; var colors = "# 33CC00"; var info = "" If (pwd==null | | pwd=='') {Lcolor=Mcolor=Hcolor=O_color;} else {S_level=checkStrong (pwd); / / detect password strength switch (S_level) {case 0: Lcolor=L_color; Mcolor=Hcolor=O_color; info = "weak"; break; case 1: Lcolor=L_color; Mcolor=Hcolor=O_color; info = "weak"; break Case 2: Lcolor=Mcolor=M_color; Hcolor=O_color; info = "medium"; break; default: Lcolor=Mcolor=Hcolor=H_color; info = "strong";}} $("# strength_L"). Css ("background", Lcolor); $("# strength_M"). Css ("background", Mcolor); $("# strength_H"). Css ("background", Hcolor) $("# pw_check_info") .html (info); / / password strength hint information return;} above is about "how to realize the password strength prompt function when registering members in jQuery". I believe you all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report