<input type="password" id="password" />
<label>
  <input type="checkbox" onclick="checkPassword(this)" />
  パスワードを表示する
</label>

function checkPassword(e) {
    p = document.getElementById("password");
    if (e.checked) {
        p.setAttribute("type", "text");
    } else {
        p.setAttribute("type", "password");
    }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.