File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ import kotlinx.html.button
2+ import kotlinx.html.dom.create
3+ import kotlinx.html.js.button
4+ import kotlinx.html.js.div
5+ import kotlinx.html.js.onClickFunction
6+ import kotlinx.html.onClick
7+ import kotlinx.html.p
18import kotlin.browser.document
29import kotlin.browser.window
310
411fun main () {
12+ val div = document.create.div {
13+ p {
14+ + " Okay..."
15+ }
16+ p {
17+ + " Open dev tools and click the button!"
18+ }
19+ button {
20+ + " Click me..."
21+ onClickFunction = {
22+ println (" Who-hoo! ${it.type} " )
23+ }
24+ }
25+ }
526 document.addEventListener(" DOMContentLoaded" , {
627 console.log(" Are you ready for a good jam?" )
728 document.querySelector(" #app" )?.let {
829 window.setTimeout({
930 it.textContent = " Хола! Их бин Максимко O.o"
31+ it.appendChild(div)
1032 }, 1234 )
1133 }
1234 }, false )
You can’t perform that action at this time.
0 commit comments