Friday, 9 August 2013

GWT insert one element into another (span into anchor)

GWT insert one element into another (span into anchor)

I am trying to create the following in GWT:
<a class="blahblahblah"><span>some text</span></a>
I have an Anchor, and an InlineHTML with my content, but I can't find a
way to simply insert the span into the anchor (I need to retain a
reference to the span because I want to update its text.
The equivalent in javascript (using jQuery) would be:
var myAnchor = $('<a class="blahblahblah"></a>'),
mySpan = $('<span>some text</span>');
myAnchor.append(mySpan);
How can I achieve this in GWT?

No comments:

Post a Comment