Tema: saber el id
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/01/2011, 15:33
Avatar de chalchis
chalchis
 
Fecha de Ingreso: julio-2003
Mensajes: 1.773
Antigüedad: 21 años, 9 meses
Puntos: 21
Pregunta saber el id

hola si tengo este script

Código:
jQuery("#chatpanel a:first, #alertpanel a:first, #inipanel a:first" ).click(function() { //If clicked on the first link of #chatpanel and #alertpanel...
		
		if(jQuery(this).next(".subpanel").is(':visible')){ //If subpanel is already active...
			jQuery(this).next(".subpanel").hide(); //Hide active subpanel
			jQuery("#footpanel li a").removeClass('active'); //Remove active class on the subpanel trigger			
		}
		else { //if subpanel is not active...
			jQuery(".subpanel").hide(); //Hide all subpanels
			jQuery(this).next(".subpanel").toggle(); //Toggle the subpanel to make active
			jQuery("#footpanel li a").removeClass('active'); //Remove active class on all subpanel trigger
			jQuery(this).toggleClass('active'); //Toggle the active class on the subpanel trigger
			alert(jQuery(this).attr('id'));
			
		}
		return false; //Prevent browser jump to link anchor
	});

como puedo saber realmente el elemnto id
que llama al evento click

intente usar
alert(jQuery(this).attr('id'));

pero da vacio

saludos
espero sus comentarios
__________________
gerardo