改变某个单元格的背景 html table td bgcolor

xiaoxiao2026-06-10  12

function changeColor(){ var tableRef = document.getElementById('tb1'); var elementRef = tableRef.rows[1].cells[1]; alert(elementRef); alert(".."); elementRef.style.backgroundColor="#FF0000"; //无效的做法elementRef.bgcolor='#ffffff'// } 相关资源:html中table为每个单元格设置不同颜色和宽度
转载请注明原文地址: https://www.6miu.com/read-5049930.html

最新回复(0)