Manuel Gonz�lez Noriega wrote:
El jue, 01-04-2004 a las 16:45, "Pablo \"Menteco\" P�rez Ben�tez"
escribi�:

flatron wrote:


Agradezco las dos sugerencias recibidas, pero ambas se basan en identificar espec�ficamente cada enlace con un id. Yo busco una soluci�n m�s autom�tica, donde a los enlaces a mostrar/ocultar s�lo haga falta asignarles una clase.


Aunque no existe el metodo getElementByClass() como tal, si buscas en
Google ver�s que existen varias funciones con ese nombre que resolver�n
tu problema.

Prob� con lo siguiente pero no funciona:


<html>
<head>
<title>Change Background Color Sample</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style>
.editar {display:none}
</style>
<script>
function mostrar(classname){
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
        if (alltags[i].className==classname) {
                alltags[i].style.display="block";
        }
}
}
</script>
</head>

<body>
<a href="#" onClick="mostrar(editar);">Editar</a><br>
Cuartirolo <a href="#" class="editar">Editar</a><br>
Salam�n <a href="#" class="editar">Editar</a><br>
</body>

</html>

--
Pablo "Menteco" P�rez Ben�tez
http://www.menteco.com
Ram�rez 1105, Salto, Uruguay
ICQ: 55453271
Jabber: [EMAIL PROTECTED]

_______________________________________________
Ovillo mailing list
[EMAIL PROTECTED]
http://ovillo.org/mailman/listinfo/ovillo_ovillo.org

Responder a