Kotlinx html append native node


#1

I’m using kotlinx html builders with Kotlin-JS. I’d like to append a native DOM-Node while inside a kotlinx builder. Is it possible?

document.create.div {
            val elem: HTMLElement = someFun()
            // append is not defined. How can I do this?
            append(elem)
}

#2

append is a jQuery method. The native DOM method is called appendChild.


#3

Yes. But appendChild is not available as well. The problem is, the div is not instantiated yet. Any ideas?