I have an HTML document. In that document, there is an element (like button, div, a) with an ID. I know I can use:
Document.get().getElementById("id");
to find the required element in the HTML file. How can I add a Click handler to it? ClickHandlers only seem to be available on the Button class.
Thanks
If you’re trying to add a
ClickHandlerto a<button>, you can do that withButton.wrap().For an
<a>yo can useAnchor.wrap()(Anchors only haveClickListeners, notClickHandlers…yet)For a
<div>you can useLabel.wrap()(Labels are just<div>s).