title: How to get index (position of an item e.g 1,2,3...) of dropped element li in droppable jquery?
body: <p>I am Dragging an element and dropping in droppable area . In drop function() i am sending data to be saved in sql server database.I want to get the index of dropped (target, not source)element like: first li element will be 1, then second will be 2...and so on.</p>
  
  <p>I tried  sidemenu.Position=</p>
  
  <p>$( "#selected" ).length: its returning 1 for every dropped element.</p>
  
  <p>$(event.target).index(): its returning 3 for every dropped element.</p>
  
  <p>$(ui.placeholder).index()</p>
  
  <p>I am using jquery-3.3.1.js,jquery-ui.js,jquery-ui.css.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$('#divSelected').droppable({
  
              accept: "#available li",
              drop: function (event, ui) {    
                   //draggable.clone().appendTo(droppable);
                   $("#selected").append($("&lt;li&gt;/li&gt;").text(ui.draggable.text()));
                   var sidemenu = {};
                   sidemenu.Position = ?
  
               }
  });
  </code></pre>