Ver Mensaje Individual
  #6 (permalink)  
Antiguo 17/05/2011, 15:34
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Saber que enlace pulso

puede ser algo como esto
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
window.addEventListener('load', function() {
var ligas = document.getElementById('cont').getElementsByTagNa me('a');
for(var i = 0; i < ligas.length; i++) {

ligas[i].addEventListener('click', function() {
alert(this.id);
}, false);

}
}
, false);
</script>
</head>
<body>
<div id="cont">
<a href="#" id="l1">link1</a><br />
<a href="#" id="l2">link2</a><br />
<a href="#" id="l3">link3</a><br />
<a href="#" id="l4">link4</a><br />
<a href="#" id="l5">link5</a><br />
<a href="#" id="l6">link6</a>
</div>
</body>
</html>
si tienes alguna otra duda, pregunta el foro de javascript. es por un motivo de ordenación