how can I get innerHTML from a backdraftjs element?

12 Views Asked by At
const foo = e.div('two cheeseburgers and an order of fries');

I would like to get the innerHTML of foo.

foo.innerHTML; // nope
foo.bdDom.root; // not this either

How can I do this?

1

There are 1 best solutions below

0
On

Ok just figured this out right after I posted...

const foo = e.div('two cheeseburgers and an order of fries');

const bar = render(foo);

console.log('innerHTML is ', bar.bdDom.root.innerHTML);

...seems to work. An element that isn't rendered HAS NO html.