HTML String to Element

Just a quick on that’s racking my brain.

How do I take a string like below, and create an element of it.

Something like,

String element = "<div id ="itsadiv" class="divable"></div>;
Element element = Element.fromString(element);



Hi Hayden. I don’t recall that we have any public API for creating an Element from an arbitrary HTML string, but you can create a new component from that with [new HTML(String outerHtml)]
( If you really need the element, you can try to retrieve it from the component (as it internally has an element anyway) or take a look at what happens with that constructor and to try create the Element in similar fashion.