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