Ferma restando la domanda di prima
sono passato a questo:
Codice PHP:
<!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>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript" type="text/JavaScript">
function countChildNodes()
{
var child = document.getElementById("wrapper").getElementsByTagName('span');
alert(child.length);
alert(child[0].firstChild.nodeValue);
}
window.onload = function()
{
countChildNodes();
}
</script>
</head>
<body>
<p id="wrapper">
<span>uno</span>
<span>due</span>
<span>tre</span>
</p>
</body>
</html>
So che ci sono differenze tra i browser e l'altro
avete una function cross-browser ?