where are you changing the color? client side or server side? did you want to find out the background color? server side or client side?it is a bad idea to use background color to 决定是否删除, you should use an array or set some attribute on TR
调试欢乐多
怎样才能用一个数组去操作要删除的行呢?首先是怎么才能选定所有要删除的行?
<tr><td>hello world</td></tr>
<tr><td>hello world</td></tr>
<tr><td>hello world</td></tr>
<tr><td>hello world</td></tr>
</table><script language="javascript">
function getRow(e)
{
while (e != null && e.tagName != "TR")
e = e.parentElement; return e;
}function tbl.onclick()
{
var e = event.srcElement;
e = getRow(e);
if (e != null)
{
if (e.style.backgroundColor == "")
e.style.backgroundColor = "green";
else
e.style.backgroundColor = "";
}
}
</script>