I am trying to retrieve a parent data attribute data-date of the dragged object in JavaScript.
So i want to receive the data-date attribute <td> from where the div "drag me" was dragged from.
HTML example:
<td data-date="2/3/2020">
<div>drag me</div>
</td>
<td data-date="3/3/2020">
<-- DIV "Drag Me" will be dragged to this location --!>
</td>
I am able to retrieve the dropped data-date attribute, but cant figure out how to retrieve the dragged from data-date attribute.
JS From and TO current code
dropped = ui.draggable,
newDate = $(this).data('date'),
console.log('Date From :' + dropped.data('date')); // needs to be found
console.log('Date To:' + newDate); // Works correctly