"Windows 8 Style Password Reveal"
Bootstrap 3.1.0 Snippet by stickerboy

<div class="container"> <div class="text-center"> <div class="col-lg-6"> <h2>Windows 8 Style Password Reveal</h2> <div class="input-group"> <input type="password" class="form-control pwd" value="iamapassword"> <span class="input-group-btn"> <button class="btn btn-default reveal" type="button"><i class="glyphicon glyphicon-eye-open"></i></button> </span> </div> </div> </div> </div>
$(".reveal").mousedown(function() { $(".pwd").replaceWith($('.pwd').clone().attr('type', 'text')); }) .mouseup(function() { $(".pwd").replaceWith($('.pwd').clone().attr('type', 'password')); }) .mouseout(function() { $(".pwd").replaceWith($('.pwd').clone().attr('type', 'password')); });

Similar snippets: See More


Comments:

comments powered by Disqus