/ Published in: JavaScript
A JS function that makes bold the text of table rows ("tr" elements) when you "mouseover" them. It takes no arguments.
From book Dom Scripting by Jeremy Keith.
From book Dom Scripting by Jeremy Keith.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function highlightRows() { if(!document.getElementsByTagName) return false; var rows = document.getElementsByTagName("tr"); for (var i=0; i<rows.length; i++) { rows[i].onmouseover = function() { this.style.fontWeight = "bold"; } rows[i].onmouseout = function() { this.style.fontWeight = "normal"; } } }