C# OnFocus文本框更改Gridview标题字体?

C# OnFocus文本框更改Gridview标题字体?,c#,asp.net,javascript,coding-style,client-side,C#,Asp.net,Javascript,Coding Style,Client Side,嘿,伙计们,我有一个gridview,下面有4个用于输入数据的文本框,出于样式设计的目的,我想在用户进入/离开每个文本框时突出显示特定的列标题 我已经能够使用以下方法在焦点上突出显示整行颜色: <script language="javascript"> function headerRoll(id) { document.getElementById(id).style.color = 'yellow'; } </script> 我现在想更进一步,根据我关注的

嘿,伙计们,我有一个gridview,下面有4个用于输入数据的文本框,出于样式设计的目的,我想在用户进入/离开每个文本框时突出显示特定的列标题

我已经能够使用以下方法在焦点上突出显示整行颜色:

<script language="javascript">
function headerRoll(id) {
    document.getElementById(id).style.color = 'yellow';
}
</script>
我现在想更进一步,根据我关注的文本框,只突出显示标题中的某些列

有人能给我举一些例子或一个好的DOM教程吗?我对DOM非常讨厌。

解决了

string id = "cell0";
        //e.Row.Attributes.Add("id", "row" + e.Row.RowIndex);
        e.Row.Cells[0].Attributes.Add("id", "cell0");
        descrTxt.Attributes.Add("OnFocus", "headerRoll('"+id+"')");
string id = "cell0";
        //e.Row.Attributes.Add("id", "row" + e.Row.RowIndex);
        e.Row.Cells[0].Attributes.Add("id", "cell0");
        descrTxt.Attributes.Add("OnFocus", "headerRoll('"+id+"')");