Introduction:
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.
Description:
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, Asp.net. Now I will explain how 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, Asp.net. Now I will explain how to clear textbox value onfocus using jQuery.
Bind focus event for all textboxs to clear
values onfocus using jQuery
|
To clear Particular textbox onfocus using
jQuery
|
For complete example check below code
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Clear
Textbox onfocus using jQuery</title>
<script src="http://code.jquery.com/jquery-1.8.2.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function ()
{
$('input[type=text]').focus(function () {
$(this).val('');
})
})
</script>
</head>
<body>
<div>
<b>Enter
Text:</b>
<input type="text"
id="txtuser"
value="Welcome
to Aspdotnet-Suresh.com" />
<input type="text"
id="txtName"
value="Aspdotnet-Suresh.com"
/>
</div>
</body>
</html>
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
5 comments :
i want to create gallery of albums based on date.
data stored in sql table..table containing following fields
1.picture path
2.picturediscription
3.date
i want to display as different albums based on date....
how to do this..?
i want to do in MVC pls upadte ?
kl
how it can be implemented in asp. net textbox
just copy and paste the content, its will work
note: only runat="server" dont replace it.
Very nice code
Note: Only a member of this blog may post a comment.