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 Clear Textbox Value on focus

Apr 30, 2013

Here I will explain How to use jQuery to clear textbox value on focus or simple jQuery code snippet to clear textbox value onfocus using jQuery.

In previous posts I explained jQuery to clear textbox value, jQuery get set textbox value, jQuery disable cut copy and paste options in textbox, jQuery Create Rounded Corners Textbox and many articles relating to JQuery, JavaScript, Now I will explain how to clear textbox value onfocus using jQuery.

Bind focus event for all textboxs to clear values onfocus using jQuery

$(function () {
$('input[type=text]').focus(function () {
To clear Particular textbox onfocus using jQuery

$(function () {
$('#txtuser').focus(function () {
For complete example check below code

<html xmlns="">
<title>Clear Textbox onfocus using jQuery</title>
<script src="" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('input[type=text]').focus(function () {
<b>Enter Text:</b>
<input type="text" id="txtuser" value="Welcome to" />
<input type="text" id="txtName" value="" />

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...

i want to create gallery of albums based on date.

data stored in sql table..table containing following fields

1.picture path


i want to display as different albums based on date....

how to do this..?

Ravi Pandit said...

i want to do in MVC pls upadte ?

Anonymous said...


Unknown said...

how it can be implemented in asp. net textbox

sanju said...

just copy and paste the content, its will work
note: only runat="server" dont replace it.

Very nice code

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.