JSFiddle - React, Tailwind, and code Playground
by Eric Hynds
HTML
<ul id="ul1">
<li id="li1">Item 1</li>
<li id="li2">Item 2</li>
</ul>
<ul id="ul2">
<li id="li3">Item3 </li>
</ul>
CSS
#ul2{
background-color:red;
margin-top: 25px;
}
JavaScript
var one = $("#ul1");
var two = $("#ul2");
one.add( two ).on("click", "li", function(){
var target = $.contains(one[0], this) ? two : one;
$(this).appendTo( target );
});