Last Updated : Jan 1, 2023
Here, we are going to apply validation on password that it must contains following expression to make a strong password.
- Must contain at least one Uppercase character
- Must contain at least one Lowercase character
- Must contain at least one digit
- Must contain at least one special character
- And it must be minimum of 8 characters.
Now, let us see the following example to see how to use above expression on password validation.
- For this first of all we here create a basic structure of html. For this we use html, head, title and body with script tag. We hope you know about the basic structure of html and which html tag is used for which concept.
- Here, inside body as we see that we create two input fields. First one is to get the data from user and other is to display the output.
- Between both we create a button, on click on that button our function will be called.