I have 4 links and I need to change the href attribute in the rel attribute. I know that I canβt do this, so I'm trying to get the data from the href attribute by setting a new attribute (rel), inserting data into it, and then deleting the href attibute.
I basically do this:
$('div#menu ul li a').each(function(){ var lin = $(this).attr('href'); $('div#menu ul li a').attr('rel',lin); $(this).removeAttr('href'); }) })
it works, but it sets the same rel data in all the links that I have.
any help?
source share