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 Change Button Text Dynamically Onclick in

Jan 29, 2014

Here I will explain how to change button text dynamically in
jQuery or jQuery change button text on click dynamically.

In previous articles I explained jQuery slide div from left to right or right to left, jQuery cascading dropdownlist example in, jQuery hide div after 5 seconds, jQuery change default text selection color with css and many articles relating to css, jQuery, JavaScript,, SQL server. Now I will explain how to change button text dynamically in jQuery.

To change button text dynamically we need to write the code like as shown below

<html xmlns="">
<title>jQuery Change Button Text Dynamically</title>
<script type="text/javascript" src="//"></script>
<script type="text/javascript">
$(function () {
$('#btnclick').click(function () {
var txt = $('#btnclick').val()
if (txt == 'Show Password') {
$(this).val('Hide Password');
return false;
else if (txt == 'Hide Password') {
$(this).val('Show Password');
return false;
<form id="form1">
<input type="button" id="btnclick" value="Show Password" />
Once we run above query we will get output like as shown below

Live Demo

To check live demo click on below button

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


Shahabuddin shahab said...

Hello Sir Please post any project on converting Number to word (11:20 hr to eleven twenty hours ).

Anonymous said...

Hi Suresh,
I want tutorial on;when I click button it has process to upload excel data in sql, put some validation and then process those records. So, I want to show user loading process with message on each stage 1 data upload start. 2 data validating 3 auromach started. It is in one button click written.
how to display 3 message on one button click. I used update panel in

Give your Valuable Comments

Other Related Posts

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