title: how to restore moved <li> element?
body: <pre class="lang-js prettyprint-override"><code>const list = document.querySelector(&quot;#List&quot;);
  const list2 = document.querySelector(&quot;#List2&quot;);
  
  list.addEventListener(&quot;click&quot;, (ev) =&gt; {
    const LI = ev.target.closest(&quot;li&quot;);
    list2.append(LI);
  });
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>&lt;ul id=&quot;List&quot;&gt;
    &lt;li&gt;1&lt;/li&gt;
    &lt;li&gt;2&lt;/li&gt;
    &lt;li&gt;3&lt;/li&gt;
    &lt;li&gt;4&lt;/li&gt;
    &lt;li&gt;5&lt;/li&gt;
  &lt;/ul&gt;
  
  
  &lt;ul id=&quot;List2&quot;&gt;&lt;/ul&gt;
  </code></pre>
  <p>this code above basically will move an <code>&lt;li&gt;</code> element to another <code>&lt;ul&gt;</code>, and i want to create a function that will restore the moved <code>&lt;li&gt;</code> back to the original <code>&lt;ul&gt;</code> in its original index. so for example when i move this list <code>&lt;li&gt;3&lt;/li&gt;</code> i want the function to place it back at the original index in the first <code>&lt;ul&gt;</code>, in this case it will be placed at the third index which is in the middle of <code>&lt;li&gt;2&lt;/li&gt;</code> and <code>&lt;li&gt;4&lt;/li&gt;</code></p>
  <p>how can i achieve this?</p>