Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Toggle password visibility project template from

Project Details

Write a script that can be used to toggle the visibility of password fields.


  • What will users interact with to change the password field visibility (ex. a button or a checkbox)?
  • If users wanted to toggle the visibility of multiple password fields in a form, how could they do that?

Need help?

This project is part of the Vanilla JS Academy.

<!DOCTYPE html>
<title>Project Template</title>
<style type="text/css">
body {
margin-left: auto;
margin-right: auto;
max-width: 40em;
width: 88%;
<h1>Password Visibility</h1>
<label for="username">Username</label><br>
<input type="text" name="username" id="username">
<label for="password">Password</label><br>
<input type="password" name="password" id="password">
// Project code...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment