<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