JSFiddle - React, Tailwind, and code Playground

by hughes

HTML

<input id="no-focus"/>
<div id="drag-me">
plz drag
</div>

CSS

.fail {
  background: pink;
}

#drag-me {
  pointer-events: none;
  user-select: none;
}

JavaScript

$ = document.querySelector.bind(document);

var input = $('#no-focus');
input.addEventListener('focus', function() {
	input.classList.add('fail');
});
input.addEventListener('blur', function() {
	input.classList.remove('fail');
});