Skip to content
This repository was archived by the owner on Oct 9, 2022. It is now read-only.

Commit 71de5cd

Browse files
authored
Update events.rst
1 parent f298778 commit 71de5cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

events.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can attach event handlers to DOM elements:
99

1010
.. code-block:: kotlin
1111
12-
doc.body.new {
12+
doc.body {
1313
val label = h1()
1414
label.text("Click Me")
1515
label.on.click {
@@ -21,7 +21,7 @@ Most if not all JavaScript event types are supported, and you can read event dat
2121

2222
.. code-block:: kotlin
2323
24-
doc.body.new {
24+
doc.body {
2525
val input = input(type = text)
2626
input.on.keypress { keypressEvent ->
2727
println("Key Pressed: ${keypressEvent.key}")
@@ -39,7 +39,7 @@ Fortunately, Kweb has a solution:
3939

4040
.. code-block:: kotlin
4141
42-
doc.body.new {
42+
doc.body {
4343
val label = h1()
4444
label.text("Click Me")
4545
label.onImmediate.click {
@@ -60,4 +60,4 @@ Combination event handlers
6060

6161
A common pattern is to use both types of event handler on a DOM element. The immediate handler might disable a clicked
6262
button, or temporarily display some form of `spinner <https://loading.io/css/>`_. The normal handler would then do
63-
what it needs on the server, and then perhaps re-enable the button and remove the spinner.
63+
what it needs on the server, and then perhaps re-enable the button and remove the spinner.

0 commit comments

Comments
 (0)