Skip to content

Commit

Permalink
Adjust nullable element section
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Mar 1, 2022
1 parent 3d711a5 commit 5bfde95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/_tutorials/web/low-level-html/connect-dart-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ which returns multiple `Element` objects via
a list of elements—`List<Element>`—all
of which match the provided selector.

### Using nullable properties
### Handling nullable elements

Because DOM elements might be missing,
the `querySelector()` function returns a nullable result,
Expand Down Expand Up @@ -324,6 +324,7 @@ the queried element to the expected type:

{% prettify dart tag=pre+code %}
final paragraph = querySelector('#RipVanWinkle') [!as ParagraphElement!];
paragraph.text = 'Wake up, sleepy head!';
{% endprettify %}

To learn more about nullable types and null safety in general,
Expand Down

0 comments on commit 5bfde95

Please sign in to comment.