Skip to content
Advertisement

how to check if multiple list items has the class Name “valid”

I am working on a password validation process. when the password input in a Sign up page is clicked a list of requirement is shown
enter image description here

And if the created password respect one of the requirements a “valid” className will be added to the li that will add additional styles to it.

enter image description here

what I want to do next is to check if all requirements are respected and if so hide the list. I tried this code here but with no luck.

JavaScript

Advertisement

Answer

This is how I fixed it :

JavaScript
Advertisement