Using prepend (and append) is forbidden for addons because it accepts also strings.
To append / prepend nodes one should use insertAdjacentElement:
As you can see, work with HTML is pretty bad in addons. It may be better to use Vue, React or Angular for building complex HTML pages.
See also:
Safely insert external content into a page - Mozilla | MDN