Ho apportato delle modifiche
al codice di cui sopra
codice:
// JavaScript Document
window.onload=function()
{
if(document.getElementsByTagName && document.getElementById)
{
document.getElementById("nav").className="jsenable";
BuildList();
}
}
function BuildList()
{
var hs=document.getElementById("nav").getElementsByTagName("h3");
for(var i=0;i<hs.length;i++)
{
hs[i].onclick=function()
{
this.parentNode.className=(this.parentNode.className=="show") ? "hide" : "show";
}
}
}
l'ho modificato così
codice:
// JavaScript Document
window.onload=function()
{
if(document.getElementsByTagName && document.getElementById)
{
document.getElementsByname("ancora").className="hide";
ag=document.getElementsbyName("ancora");
hs=document.getElementsByTagName("h3");
for (var i=0;i<hs.length; i++)
{
hs[i].onclick=function()
{
ag[i].classname=(ag[i].classname=="show") ? "hide" : "show";
}
}
}
}
Cosa ho sbagliato nella sintassi?