Eric,
$('a').addClass("myclass").attr('rel','myotherlink'); should do ya.

On 10/2/07, Eric <[EMAIL PROTECTED]> wrote:
>
>
> I understand how to add a class to existing href tags, for example
>
> $("a").addClass("myclass");
>
> I would also like to be able to add a 'rel' attribute to the href
> tags, dynamically using jQuery.
>
> For example, my html would have existing:
>
> <a href="somelink">....</a>
>
> The jQuery then adds "myclass" but I also want to add a
> rel="myotherlink" too, so I would have a result:
>
> <a href="somelink" class="myclass" rel="myotherlink">...</a>
>
> I would like to avoid directing adding rel="myotherlink" into the html
> href tags, if at all possible.
>
> Thanks!
>
>


-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com

Reply via email to