Show Password Button
Does anyone know how to implement the show password like on Twitter please?
change the type from type="password" to type="text" using jquery or something.
When you click the "Show password" button, just make sure the target input element type attribute is changed from "password" to "text".
So if you had a "Show password" button, and an input where user enters his password, like so:
<input type="password">
what you would do (with Javascript) is just change the type from "password" to "text".
Would anyone know how I could do it with a check box and some jquery please?
Here's an example using a checkbox:
<script>
$(document).ready(function(){
$('#checkbox').on('change', function(){
$('#password').attr('type',$('#checkbox').prop('checked')==true?"text":"password");
});
});
</script>
<input type="password" id="password">
<input type="checkbox" id="checkbox">Show Password
Please or to participate in this conversation.