Wednesday, 7 August 2013

Remove self tag

Remove self tag

i have a litte bug, in my menu there's some links that has no hrefs. If it
has not href, i want to remove this but keep the text.
this is what i got:
$('.mainmenu a, .mainmenu a *').each(function(){
var href = $(this).attr('href');
if(!href)
{
console.log($(this).html());
//Remove <a> from this element, how?
}
});
help please?

No comments:

Post a Comment