Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/05/2009, 16:54
Avatar de pato12
pato12
 
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Respuesta: elementos con el mismo id

Hola,
Aqui tienes un ejemplo:
Código javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Documento sin t&iacute;tulo</title>
  6. <script type="text/javascript">
  7. <!--
  8. onload=function(){
  9.     var cajas=document.getElementsByName("Cajas");
  10.     for(var i=0; i<cajas.length; i++){
  11.         alert("Caja "+(i+1)+", imagen: "+cajas[i].src);
  12.     }
  13. }
  14. -->
  15. </script>
  16. </head>
  17.  
  18. <body>
  19. Imagen 1<IMG src='imagen1.gif' name="Cajas">
  20. Imagen 2<IMG src='imagen2.gif' name="Cajas">
  21. Imagen 3<IMG src='imagen3.gif' name="Cajas">
  22. </body>
  23. </html>
Suerte
Salu2
__________________
Half Music - www.halfmusic.com