mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +00:00
![Timothy Flynn](/assets/img/avatar_default.png)
This is often used on login forms, for example, to toggle the visibility of a password. The site will change the <input> element's type to "text" to allow the password to show.
8 lines
232 B
HTML
8 lines
232 B
HTML
<input type="password" value="hunter2" />
|
|
<script type="text/javascript">
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
let input = document.querySelector("input");
|
|
input.type = "text";
|
|
});
|
|
</script>
|