I have this code written and my customer wants this lists item's inner HTMLs to stay the same even if we change the places.
For example, if I go drag first element to the third place, the animation will occur but then, the list will stay the same as "Firs -> Second -> Third".
Any thoughts on how can I do it using JavaScript code?
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Drag & Drop Element</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.10.2/Sortable.min.js"></script>
</head>
<body>
<div class="wrapper">
<div class="item first">
<span class="text">First element</span>
<i class="fas fa-bars"></i>
</div>
<div class="item second">
<span class="text">Second element</span>
<i class="fas fa-bars"></i>
</div>
<div class="item third">
<span class="text">Third element</span>
<i class="fas fa-bars"></i>
</div>
</div>
<script>
const dragArea = document.querySelector(".wrapper");
new Sortable(dragArea, {
animation: 350
});
</script>
</body>
</html>