How would I combine these 2 onloads together. Right now they don’t work with each other and gives me an error. Seperate the scripts work fine. Note: They both work off the same <table id=”table1″>
<head>
<script type=”text/javascript”>
onload=function(){
var cells = document.getElementById(‘table1’).getElementsByTagName(‘tbody’)[0].getElementsByTagName(‘td’);
var v=0;
for(var i=4;i<cells.length;i+=5) {
v+= Number(cells[i].firstChild.data);
}
var av = (v*5)/cells.length
document.getElementById(‘average’).firstChild.data=av.toFixed(2)
}
</script>
<body onload=”ezcolrow(‘table1’);”>
<script>
function ezcolrow(el)
{
var ele = document.getElementById(el);
for(x = 1; x < ele.rows.length; x++)
{
ele.rows[x].style.height = “20px”
if (x%2 == 0)
{
ele.rows[x].style.backgroundColor = “#dddddd”;
}
else
{
ele.rows[x].style.backgroundColor = “#FFFFFF”;
}
}
}
</script>
</head>