no tienes que crear el Array 'links', ya es parte de
Javascript. Y me disculpo xq habia un error, hazlo
asi:
function editar() {
for(a=0;a<document.links.length;a++) {
if (document.links[a].class == 'editar') {
document.links[a].style.visibility =
'visible';
}
}
otra opcion, como te comentaba, es
var misLinks = document.getElementsByTagName('a');
var linksSize = misLinks.length;
y luego dentro del bucle 'for' utilizas:
misLinks[i].setAttribute('className', 'editar');
para cambiar el nombre de la clase.
Una ultima opcion, sin javascript es la que te
presentan aqui:
http://www.meyerweb.com/eric/css/edge/menus/cut2.html
suerte,
Eric Rodriguez
--- "Pablo_\"Menteco\"_P�rez_Ben�tez"
<[EMAIL PROTECTED]> wrote:
> Eric Rodriguez wrote:
> > No entiendo bien, ni el objetivo de hacer eso ni
> lo
> > que pretendes hacer. Creo que lo que quieres es
> que
> > al pinchar en editar aparezcan los nombres de los
> > articulos???
> >
> > Por cierto, vale usar
> > "document.getElementsByTagName"???
> >
> > En todo caso, basta con que llames al array de
> links
> > (document.links[i].style.className = 'editar') si
> es
> > IE y (document.links[i].style.class = 'editar') si
> es
> > Mozilla. Por supuesto, dentro de un bucle "for".
>
> Prob� con lo siguiente pero no funciona. Seguramente
> estoy cometiendo
> varios errores en el c�digo pero no s� cuales :-(
>
> <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 editar() {
> var links=new Array();
> for(a=0;a<links.length;a++) {
> if (document.links[a].style.class == 'editar') {
> document.links[a].style.display = "inline";
> }
> }
> }
> </script>
> </head>
>
> <body>
> <a href="#" onClick="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
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
_______________________________________________
Ovillo mailing list
[EMAIL PROTECTED]
http://ovillo.org/mailman/listinfo/ovillo_ovillo.org