Change background / text color using Javascript
CherniFeb 12 2007 — edited Feb 13 2007Hi all,
I am developing using Application Express 1.6 and I need to be able to highlight a row, either change the background color or the the text color when a user clicks an icon to view more info on the row. I have tried changing the javascript that changes the background color onmouseover but it doesnt seem to work. here is the code
<script language="Javascript">
function dochangebackground(rowNode,currentRowNum) {
for( var i = 0; i < rowNode.childNodes.length; i++ ) {
if (rowNode.childNodes.tagName=='TD') {
rowStyleHover[currentRowNum] = rowNode.childNodes[i].style.backgroundColor;
rowNode.childNodes[i].style.backgroundColor = '#000000';
}
}
}
</script>
and the call to the script is -> javascript:onClick=dochangebackground(this,'#ROWNUM#');
This is placed in the column link section of the id i am passing. the target is a url.
Does anyone have any ideas on how to accomplish this or a better way to do it?
Thanks a mil!