refer this sample
<html>
<head>
<script src="jquery.js"></script>
<script>
$(function () {
var initialValue = '';
$(".TextBoxBlurEffect").on('focus', function () {
initialValue = this.value;
this.value = '';
}).on('blur', function () {
var value = this.value;
if (value == '')
this.value = initialValue;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView runat="server" ID="gv" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Test">
<ItemTemplate>
<asp:TextBox ID="txtbox1" CssClass="TextBoxBlurEffect" Text="NA" runat="server"> </asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack) return;
gv.DataSource = new int[] {1,2,3,4,5 };
gv.DataBind();
}
demo:
JSFiddle[
^]