Suppose I have a single HTML element that I want to be replaced in the body
i.e. this is the body
<p> some random element </p>
<a href="#" id="dfd32"> some text</a> // this element to replace
<h1> some random element </h1>
Now I want this element to get replaced by an array of elements
[
<a href="#" id="dsd32dsd"> 23dfsome text12</a>,
<a href="#" id="dfwedwew"> sdfsome text23</a>,
<a href="#" id="dssfd"> somdfse text2</a>
]
the final body after getting replaced will be
<p> some random element </p>
<a href="#" id="dsd32dsd"> 23dfsome text12</a>
<a href="#" id="dfwedwew"> sdfsome text23</a>
<a href="#" id="dssfd"> somdfse text2</a>
<h1> some random element </h1>
How to do that ? I tried with replaceWith
but not able to do it.