Mozilla recommends application/x-moz-node for dragging nodes in a document, although this will obviously only work in Gecko-based browsers. This is simpler and generally more compatible with setting the link to the element as text, as you already did, and then using the link to capture the element in the drop event and move it to the code in the right place.
source share