Attach to dynamic components

using vaadin 12.

i have a div that is used as a parent to move one of a set of divs into.

the selected child div is placed into the parent via JavaScript.

I’m using @Id in Java to attach to the parent.
the question is how do i find the child the JavaScript had moved in.

I’ve tried Element.getchildren but it returns an empty set.

i can get the id of the child element but i still can’t work out how to attach to this dynamically acquired id.

This might help to better explain the requirement (now I’m not on mobile).

<div id="parent">

The following is pseudo code. Its purpose is to demonstrate a javascript polymer component dynamically creating and adding a child element.

	let child = document.createElement("div");
	child.setAttribute("id", "child");

This is the java that needs to access the child:

class X
	Div parent;
	void someMethod()
		// this doesn't work, but is essentially what is required.
		// How do I get the child?
		Element child = parent.getChildById("child");
		// do something with child.