---
title: "Comment by Simone Gentili on \"Creating a Kanban Board with HTML, CSS & JavaScript\" | Hashnode"
description: "Avoid putting task into each others simply adding .closest(&#39;.skanban-block&#39;) : function drop ( ev ) { ev.preventDefault(); var data = ev.dataTransfer.ge"
url: "https://hashnode.com/posts/creating-a-kanban-board-with-html-css-and-javascript/60c5ba2d1679ed6f51a27987/comment/6254f295b32ddd968bbea7af"
---

[Discussion](https://hashnode.com/posts/creating-a-kanban-board-with-html-css-and-javascript/60c5ba2d1679ed6f51a27987)

Comment [Creating a Kanban Board with HTML, CSS & JavaScript](https://hashnode.com/posts/creating-a-kanban-board-with-html-css-and-javascript/60c5ba2d1679ed6f51a27987)

[Apr 12, 2022](https://hashnode.com/posts/creating-a-kanban-board-with-html-css-and-javascript/60c5ba2d1679ed6f51a27987/comment/6254f295b32ddd968bbea7af)

Avoid putting task into each others simply adding `.closest('.skanban-block')`:

```
function drop(ev) {
    ev.preventDefault();
    var data = ev.dataTransfer.getData("text");
    ev.target
      .closest('.skanban-block')
      .appendChild(document.getElementById(data));
}
```

Another nice feature is to move a task between two to sort tasks.
