У меня есть серия тегов p
на моей странице, и я хочу их обернуть в контейнер, например.
<p>foo</p>
<p>bar</p>
<p>baz</p>
Я хочу обернуть все вышеуказанные теги в контейнер следующим образом:
<div>
<p>foo</p>
<p>bar</p>
<p>baz</p>
</div>
Как обернуть NodeList
в элемент с использованием ванильного JavaScript?