1

I have the following HTML:

<ul id="randomList">
  <p>test</p>
  <p>test</p>
  <p>test</p>
  <p>test</p>
</ul>

How can I use vanilla JS to select #randomList and change the parent element's tags (both beginning and ending tag) so the output is the following:

<div id="randomList">
  <p>test</p>
  <p>test</p>
  <p>test</p>
  <p>test</p>
</div>

Thanks!

Ralph David Abernathy
  • 5,230
  • 11
  • 51
  • 78

0 Answers0