Try this.
Code-behind
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
string script = String.Format("javascript:return DeleteGridView('{0}');", gvAttribute.ClientID);
txtPercentage.Attributes.Add("onkeydown", script);
}
}
Javascript
function DeleteGridView(grid_id) {
var grid = document.getElementById(grid_id);
if (grid.parentNode) {
grid.parentNode.removeChild(elem);
}
return false;
}