<html>
<head>
<title>Problema</title>
<script language="javascript" src="funciones.js" type="text/javascript"></script>
</head>
<body>
<div id="bloque">
<p>Este es el primer párrafo</p>
<p>Este es el segundo párrafo</p>
<p>Este es el tercer párrafo</p>
</div>
<input type="button" value="Cambiar colores" onClick="cambiarColores()">
</body>
</html>
function cambiarColores()
{
var lista=document.getElementById('bloque');
lista.childNodes[0].style.color='#ff0000';
lista.childNodes[1].style.color='#00ff00';
lista.childNodes[2].style.color='#0000ff';
alert('La cantidad de hijos del nodo div es:'+lista.childNodes.length);
}