Skip to content

Commit

Permalink
Issue #9: methods used without intro
Browse files Browse the repository at this point in the history
  • Loading branch information
professor-ben committed Mar 25, 2022
1 parent 7f9bd07 commit deb9313
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Why not?

## Add Elements to the DOM

To get an element to appear in the DOM, we have to `append` it to an existing
To get an element to appear in the DOM, we have to `append()` it to an existing
DOM node. To go back to our tree metaphor, we have to glue our new leaf onto a
branch that's already there. We can start as high up on the tree as
`document.body`, or we can find a more specific element using any of the methods
Expand All @@ -56,7 +56,9 @@ document.body.append(element);
```

Now if you look at the Elements tab, you'll see our new (empty) `<div>` nested
inside the `body` element. Let's give it some content:
inside the `body` element. The value that we set `li.textContent` to must be a
`String`. To change our `i + 1` from an `Int` to a `String`, we will use
JavaScript's built-in `toString()` function:

```js
const ul = document.createElement("ul");
Expand Down

0 comments on commit deb9313

Please sign in to comment.