Adding the same function inside a function

So I basically want to do this:

label.addEventListener('dragend', function(event){
    id++
    var newItem = document.createElement("input" + id)
    newItem.addEventListener('dragend', THISFUNCTION)
    document.getElementById("list").appendChild(newItem)
})

The idea is that when you stop dragging an item another appears and it has the save event and so on. How to do this?