Jquery – Show hide password in Password textbox using checkbox.
In this post we will give you information about Jquery – Show hide password in Password textbox using checkbox.. Hear we will give you detail about Jquery – Show hide password in Password textbox using checkbox.And how to use it also give you demo for it if it is necessary.
In this post we can implement how to add hide show password when user input password at register time or login time. We sometimes require to do it because that use can determine password is right or wrong.
In this example i use just jquery change event on checkbox, if check then user can see his entered password and change anything, so you can see preview and also check demo with code.
Preview:
Example:
<html lang="en">
<head>
<title>Jquery - Show hide password in Password textbox using checkbox</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
</head>
<body>
<div >
<h2>Jquery - Show hide password in Password textbox using checkbox</h2>
<input type="password" name="password" />
<input type="checkbox" />Show Password</div>
<script type="text/javascript">
$(document).ready(function(){
$('.showPassword').on('change',function(){
var isChecked = $(this).prop('checked');
if (isChecked) {
$('.my-password').attr('type','text');
} else {
$('.my-password').attr('type','Password');
}
});
});
</script>
</div>
</body>
</html>
Hope this code and post will helped you for implement Jquery – Show hide password in Password textbox using checkbox.. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs