Can i use kotlinx.html with document in kotlin-js?

330 views Asked by At

Now i work on kotlin-js project. And i want to Add some HTML tag in my index.html. So i want to use kotlinx.html. Is it available using kotlinx.html in kotlin-js code?

Like This one

import kotlin.browser.document

document.create.p{+"hello world}

If it isn't please let me know how to add Tag Attribute or HTML Tag using kotlin-js.

1

There are 1 answers

0
Animesh Sahu On

You can use kotlinx-html(npm) for js. Download latest version of kotlinx-html from npm

npm install kotlinx-html

Here is the Readme for Kotlin/JS users. You can naturally build html as you do in kotlin/JVM.