Skip to content

Commit 3992d23

Browse files
authored
Update part0b.md
A more precise definition w.r.t the context for easier understanding.
1 parent 6bd23ab commit 3992d23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/0/en/part0b.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ form.onsubmit = function(e) {
549549
}
550550
```
551551
552-
The command <em>document.getElementById('notes_form')</em> instructs the code to fetch the form element from the page and to register an <i>event handler</i> to handle the form's submit event. The event handler immediately calls the method <em>e.preventDefault()</em> to prevent the default handling of form's submit. The default method would send the data to the server and cause a new GET request, which we don't want to happen.
552+
The command <em>document.getElementById('notes_form')</em> instructs the code to fetch a reference to the HTML form element on the page that has the ID "notes_form" and to register an <i>event handler</i> to handle the form's submit event. The event handler immediately calls the method <em>e.preventDefault()</em> to prevent the default handling of form's submit. The default method would send the data to the server and cause a new GET request, which we don't want to happen.
553553
554554
Then the event handler creates a new note, adds it to the notes list with the command <em>notes.push(note)</em>, rerenders the note list on the page and sends the new note to the server.
555555

0 commit comments

Comments
 (0)