HTML file:
<a id="search">Search</a>
GWT Module:
Anchor searchLink = new Anchor("Search", Window.Location.createUrlBuilder().setPath("search.html").buildString());
RootPanel.get("search").add(searchLink);
Results in:
<a id="search">Search
<a class="gwt-Anchor" href="http://127.0.0.1:8888/search.html?gwt.codesvr=127.0.0.1:9997">Search</a>
</a>
Is there a way for me to edit the existing anchor (replacing its body) instead of inserting inside it?
Use
Document#getElementById()to get the existing anchor Element instead ofRootPanel#get():