0

I am going put external element into inner html using drag & drop. So I assume like this. This is inner html.

<div class="inner_html">
   <div class="title">
     <h1>This is title</h1>
   </div>
   <div class="body">
     <li>this is element</li>
     <a>element</a>
   </div>
</div>

Here is external html. <div>This is external element</div>

I am going to drag external element and drop into inner html. So final element can get a lot of results. I think if position were absolute, then it can be done easily using jquery draggable plugin. But I don't want absolute position. just want to put into inner html.

Can anyone help me?

LoveCoding
  • 1,121
  • 2
  • 12
  • 33
  • 1
    If i understood correctly, you'd first need code to detect the initial mouse click and the objeck clicked. Then, detect the release point and the object over which the release happened. Finally, clone the first element into the last one and remove the leftover. Also check this: https://stackoverflow.com/questions/22799779/drag-element-from-inside-one-div-into-another – user2464424 Apr 06 '20 at 15:31
  • Thanks, I will check it. – LoveCoding Apr 06 '20 at 15:41
  • 1
    Please review: https://jqueryui.com/droppable/ this is a basic Drag and Drop example with jQuery UI library. – Twisty Apr 06 '20 at 19:51
  • 1
    Also `
  • ` should not be a child of `
    `.
  • – Twisty Apr 06 '20 at 20:02
  • https://snipboard.io/Bx0W7A.jpg well I was going to drop this image but it didn't work. just working as draggable, as position relative. – LoveCoding Apr 06 '20 at 20:08