How it works…
In this recipe, we have a simple form, with two input fields (an email address field and a password input field) and a submit button. The password input field has an input add-on button on its right side, with the button styled using the contextual btn-danger class. Inside the button, we see an icon of a closed padlock.
The idea is pretty simple, we want to allow the user to click on the input add-on button, on the right edge of the password input field. This click will change the visibility of characters in the password input field. The obscured password characters are made visible via a simple change of the type attribute from password to text. At the same time, the input add-on button changes its contextual color from danger ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access