Adding asterisks instead of dots
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<legend>LOGIN</legend>
|
||||
<div class="login-container">
|
||||
<input class="tui-input" type="text" name="login-user" id="login-user"><br><br>
|
||||
<input class="tui-input" type="text" name="login-pass" id="login-pass"><br><br>
|
||||
<input class="tui-input" type="password" name="login-pass" id="login-pass"><br><br>
|
||||
<button type="submit" id="login-submit-button">Login</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -59,4 +59,14 @@
|
||||
console.error(error);
|
||||
});
|
||||
});
|
||||
|
||||
// Replace the dots by asterisks
|
||||
loginPass = document.getElementById("login-pass")
|
||||
loginPass.addEventListener("keydown", function() {
|
||||
|
||||
const curVal = loginPass.value;
|
||||
const newVal = curVal.replace(new RegExp(curVal, 'g'), '*');
|
||||
|
||||
loginPass.value = newVal;
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user