rel attribute on anchor tag

8 views
Skip to first unread message

Nick Cronin

unread,
Dec 22, 2009, 11:57:53 PM12/22/09
to Google Web Toolkit
Hi,
Is there a way to assign a rel attribute on an anchor tag via the
"Anchor" object? There's no setRelationship or anything obvious and
I'm sure it's quite simple I just can't see it easily =)
Thanks

Thomas Broyer

unread,
Dec 23, 2009, 10:03:48 PM12/23/09
to Google Web Toolkit

A bit "low level" but quite "easy" nevertheless:

myAnchor.getElement().<AnchorElement>cast().setRel("nofollow");

or if you don't like this cast() syntax:

AnchorElement elt = myAnchor.getElement().cast();
elt.setRel("nofollow");

Reply all
Reply to author
Forward
0 new messages