Q:

1.js:23 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'

I am trying to use drag and drop interface for moving some input within his form and there are the two functions-handlers for that: 
let drag = (event) => {
    event.dataTransfer.setData("application/x-moz-node", input1);
    event.dataTransfer.effectAllowed = "move";
};

let drop = (event) => {
    event.preventDefault()
    let data = event.dataTransfer.getData("application/x-moz-node");
    event.target.appendChild(document.getElementById(data));
}

and whenever I am trying to drop the input element on it's her position, I get the error. How should I fix it and what is the reason?

A:

getElementById searches the DOM tree for an element having the id you specified as parameter. In your case it is the value of input1.
So, you have to set the id of the div that you drag to the value of the input1.
As I don't think that is what you intended, you should put an id to the draggable element :
<div id="draggable-element" draggable="true" ondragstart="drag(event)">

And then : 
ev.target.appendChild(document.getElementById('draggable-element'));

Or you can pass it like:
event.dataTransfer.setData("application/x-moz-node", input1);
event.dataTransfer.setData("my-draggable-id", ev.target.id);

and then : 
let data = event.dataTransfer.getData("application/x-moz-node");
let draggableId= event.dataTransfer.getData("my-draggable-id");
event.target.appendChild(document.getElementById(draggableId));

Here is a fiddle

