Код: Выделить всё
//var parent = document.getElementById('parent');
//var parent = document.querySelector('ul#parent');
//var child_nodes = parent.childNodes;
//parent.appendChild(document.createElement('li'));Код: Выделить всё
Live vs Non-live
List King
Buy groceries
[list]
[*]fresh figs
[*]pine nuts
[*]honey
[*]balsamic vinegar
[/list]
Независимо от того, выбираю ли я родительский идентификатор с помощью getElementById или querySelector, они все равно обновляют документ и добавляют дочерний li.
Подробнее здесь: https://stackoverflow.com/questions/414 ... ollections
Мобильная версия