This should do it:
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<
head><title></title> <script type="text/javascript">
window.onload = function() {
var mainTable = document.getElementById("TableContainer")
,selectionCriterion = "1" /* what's inside the "title" attribute */
,selectedRowColor = "#FF0000" /* the color to apply to the selected row */
,AllRows = mainTable.getElementsByTagName("tr");
for (var i = 0; i < AllRows.length; i++) {
var selectedRows = AllRows[i];
if (selectedRows.getAttribute("title") == selectionCriterion) {
selectedRows.style.background = selectedRowColor;
}
}
};
</script>
</
head><body>
<
table id="TableContainer"><tr title="1"><td>1</td><td>Item 1</td></tr>
<
tr title="1"><td>1a</td><td>Item 1a</td></tr><tr title="2"><td>2</td><td>Item 2</td></tr>
<
tr title="3"><td>3</td><td>Item 3</td></tr></table> </body>
</
html>
hth
Enter your message below
Sign in or Join us (it's free).