JSFiddle - React, Tailwind, and code Playground

by Chuan Shao

HTML

<input type=checkbox name="test" id="test" onclick="check(event)">

CSS

#test:before {
  content: "TestValue";
  padding-left: 20px;
}

JavaScript

window.check = function(e) {
  var offsetX = e.offsetX;
  if (offsetX > 20) {
  	e.preventDefault();
  }
}