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

Commit

Permalink
Update dom.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 8, 2020
1 parent acd5fb3 commit 7ea2d21
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ Or delete it:
button.delete()
Adding children to an existing element
--------------------------------------

The DSL syntax makes it very easy to create elements and their children together:

.. code-block:: kotlin
ul {
li().text("One")
li().text("Two")
}
However we can also use the `new {}` function on `Element`s to add children to a pre-existing element:

.. code-block:: kotlin
val unorderedList : = ul()
unorderedList.new {
li().text("One")
li().text("Two")
}
Reading from the DOM
--------------------
Expand Down

0 comments on commit 7ea2d21

Please sign in to comment.