<table id="tableId">
<tr>
<td>
</td>
</tr>
</table>
onclick으로 클릭 시 function으로 이동하게 함. 이때, onclick="javascript:HighlightRow(this);" 이런 식으로 세팅함
function HighlightRow(obj){
var table = document.getElementId("tableId");
var tr = table.getElementsByTagName("tr");
for(var i=0; i<tr.length; i++){
tr[i].style.background = "white";
}
obj.style.backgroundColor = "#FCE6E0";
}
Rme.




최근 덧글