usban
09-14-2002, 12:55 AM
I'm using this code in my web page and it works perfectly, but when i've tried it in a Netcape browser i've seen that it doen't work. I don't know where is the problem or which is the property that netscape doesn't support. I would like to know i i can do something similar to that in netscape and how.
<html>
</head>
<script>
function oculta(id)
{
obj = eval(id);
if(obj.style.display == "none")
{
obj.style.display = "";
}
else
{
obj.style.display = "none";
}
}
</script>
</head>
<body>
<ul>
<li> <a href="javascript:oculta(tab)"> tablas </a> </li>
<ul style="display:none" id="tab">
<li> 1 </li>
<li> 2 </li>
</ul>
</ul>
</body>
</html>
<html>
</head>
<script>
function oculta(id)
{
obj = eval(id);
if(obj.style.display == "none")
{
obj.style.display = "";
}
else
{
obj.style.display = "none";
}
}
</script>
</head>
<body>
<ul>
<li> <a href="javascript:oculta(tab)"> tablas </a> </li>
<ul style="display:none" id="tab">
<li> 1 </li>
<li> 2 </li>
</ul>
</ul>
</body>
</html>