JSFiddle - React, Tailwind, and code Playground

by Shree Khanal

HTML

<ul id="tree">
    <li id="1">test1</li>
     <li id="2">test2</li>
     <li id="3">test3</li>
     <li id="4">test4</li>
</ul>

JavaScript

$("#tree li").draggable().droppable({

                    element: '#tree',
                    tolerance: 'pointer',
                    aroundTop: '25%',
                    aroundBottom: '25%',
                    aroundLeft: 0,
                    aroundRight: 0,
                    drop: function(event,ui) {
                         alert(ui.overState);
                        id = $(this).attr("id");
                        //alert(id);
                    }
                });