Foros del Web » Programando para Internet » Javascript » Frameworks JS »

saber el id

Estas en el tema de saber el id en el foro de Frameworks JS en Foros del Web. 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')){ ...
  #1 (permalink)  
Antiguo 27/01/2011, 15:33
Avatar de chalchis  
Fecha de Ingreso: julio-2003
Mensajes: 1.773
Antigüedad: 20 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

Etiquetas: ajax
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:28.