I have the following html structure :
<span>foobar</span>
I would like to wrap the text content of this span into another tag like this using pure javascript :
<span><p>foobar</p></span>
I already tried this but without success :
span.appendChild(virtualDoc.createElement('p'));
Thanks for reading me !
` inside `` is invalid HTML markup?
– Roko C. Buljan Apr 28 '22 at 08:52