> Faqs > Obtener nombre etiqueta

Obtener nombre etiqueta

Hola a todos..
tengo este codigo:

 $("#menu a").each(function(){  
    var href = $(this).attr("href");  
   
    if (id <> "lp") {  
      $(this).attr({ href: "#"});  
      $(this).click(function() {  
        $("#detalle").load(href);  
      });  
    }  
 });

ahora, quiero que solo se cambien los enlaces a # pero si el id NO ES con nombre lp... puse ese if pero no le da bolilla..
alguna idea??

Respuestas

Prueba con

$("#menu a\[id!=lp\]").each(function(){  
 var href = $(this).attr("href");  
 $(this).attr({ href: "#"});  
 $(this).click(function(){  
 $("#detalle").load(href);  
 });  
 });  

Revisa la documentación de jQuery, ahí está en selectors cómo hacer selecciones para excluir tags Espero te sirva.

Cristian Avila Montalvo