JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" name="mybox" id="mybox" value="test" onclick="noCheck(event)" />
JavaScript
var user = { premium : true };
function noCheck (e) {
e = e || window.event;
if( !user.premium ) {
e.preventDefault();
alert("not allowed");
};
};