aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Show Hide Password Characters or Field without Any Plugin

Jan 27, 2014

Here I will explain how to use
jQuery to show hide password characters or jQuery show hide password field.

In previous articles I explained JavaScript show number of characters remaining in textarea, jQuery set maxlength for multiline textbox, jQuery stop form being submit on keypress, jQuery check undefined or empty value and many articles relating to jQuery, JavaScript,, SQL server. Now I will explain how to show or hide password characters using jQuery.

To show or hide password characters in jQuery we need to write the code like as shown below

<html xmlns="">
<title>jQuery Show or Hide Password</title>
<script type="text/javascript" src="//"></script>
<script type="text/javascript">
$(function () {

$('#btnclick').click(function () {
var txt = $('#btnclick').val()
var pwd = $('#hidepwd').val();
if (pwd.length > 0) {
if (txt == 'Show Password') {
$(this).val('Hide Password');
return false;
else if (txt == 'Hide Password') {
$(this).val('Show Password');
return false;
else {
alert('Plese Enter Password');
return false;

<form id="form1">
<b>Enter Password: </b>
<input type="password" id="hidepwd" />
<input type="text" id="showpwd" />
<input type="button" id="btnclick" value="Show Password" />
Once we run above query we will get output like as shown below

Live Demo

Enter Password:

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...


Anonymous said...


Unknown said...

Dear Suresh ji, Please teach us MVC. You can plan CRUD functionality in MVC 3 or 4 page application. In that you can show JQuery stuff also. I want to learn thats why i am giving the suggestion.

Unknown said...

Hi Suresh Sir, i have a web cam and it captures a face and i want to compare capture face with stored face picture . how can i do it . the capture face is displaying on picture box . Code written in C#

Bhagawat007 said...

Very good

Anonymous said...

Sir, I like Your every post,

sir is there any way of uploading file to server by FTP

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.