Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/07/2009, 06:39
Avatar de djaevi
djaevi
 
Fecha de Ingreso: marzo-2007
Ubicación: Moreno, Buenos Aires
Mensajes: 400
Antigüedad: 17 años, 2 meses
Puntos: 47
Respuesta: acceder a this

tendrias que añadir un parametro a tu funcion para detectar el enlace y lo cambias con el parametro .text

Código javascript:
Ver original
  1. function showhide(id,enlace){
  2.    el = document.getElementById(id);
  3.    el.style.display = (el.style.display != 'block')? 'block' : 'none';
  4.    enlace.text = (enlace.text != 'Abrir')? 'Abrir' : 'Cerrar';
  5. }

en el html paso el 2do parametro como this...

Código HTML:
<a onclick="showhide('miDiv',this);return false;"href="">Abrir</a>