Simple javascript to toggle password visibility
Your HTML structure nneded for this to work is as simple as:
Add javascriptmy_secret_password
$(function() {
/**
* Hide password with bulets and make it toggle
*/
$("div.password").contents().wrap('<span class="pass" />');
$('span.pass').before('<span class="bullets">••••</span>').hide();
$("div.password").click(function(){
$('span.pass',this).toggle();
$('span.bullets',this).toggle();
});
});
And the result is:
my_secret_password


