JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">test</div>
<div id='draggable' draggable='true'></div>

CSS

#draggable {
  width: 100px;
  height: 100px;
  background: red;
  margin: 10px 5px;
}

JavaScript

var draggable = document.getElementById('draggable'),
  test = document.getElementById('test');

document.addEventListener("dragend", function(event) {
  // reset the transparency
  console.log('dragend');
}, false);

draggable.addEventListener('dragstart', function(event) {
  test.style.color = 'red';
  draggable.style.backgroundColor = 'gray';
}, false);