Possible Duplicate:
remove attribute of html tag
I have some jQuery in my code that adds a rel attribute to all a tags in my code. I don't want to remove the code that adds these rel attributes but instead wanted to remove these rel attributes using JavaScript/jQuery. I am able to do reset the rel attributes to empty string thus:
var $this = $(this);
var $items = $this.find('a');
$items.attr('rel', '');
Instead though, what I'd like to do is remove the rel tag altogether. Does anyone know how to do this?
Try removeAttr()
http://api.jquery.com/removeAttr/
$items.removeAttr('rel');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With