当前位置:编程学习 > asp >>

一个改变最后选中datagrid的Color的javascript

var Supplier_LastSelectRowId = "";
function Supplier_selectRow(sender)
{ if(Supplier_LastSelectRowId != "") { var lastSelectRow = window.document.getElementById(Supplier_LastSelectRowId); if (lastSelectRow != null) { lastSelectRow.runtimeStyle.backgroundColor = ""; } } var selectRow = Supplier_GetParentElementByTagName(sender, "TR"); //window.document.getElementById(sender.id); if (selectRow != null) { selectRow.runtimeStyle.backgroundColor = "#CAD3E4"; Supplier_LastSelectRowId = selectRow.id; //sender.id; //SupplierName.innerHTML = sender.innerHTML; } }
function Supplier_GetParentElementByTagName(element, tagName) { var element=element; while(element.tagName != tagName) element = element.parentNode; return element; }

补充:asp教程,数据库相关
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,