HTML and CSS Reference
appending a nested list
" item 1 "
" item 2 "
" item 3 "
corresponding node tree
to it using the following commands:
var nestedList = document.createElement(“ol”);
The nested list is then appended as a child of the previous—and currently last—entry in
the current list, which can be done using the following command:
Finally, you'll need to set the nested list as the new table of contents so that the text of
subsequent headings is added to it. You'll run the following command to change the
reference of the TOCList variable:
TOCList = nestedList;
You'll add these commands to the second if condition in the createList() function now.