JSFiddle - React, Tailwind, and code Playground
HTML
<button onclick="fDisableSelect('-webkit-')">webkit</button>
<button onclick="fDisableSelect('-moz-')">moz</button>
<button onclick="fDisableSelect('-ms-')">ms</button>
<p>Select this</p>
<p class='predefined'>
Predefined
</p>
CSS
.predefined{
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
}
p{
font-size:32px
}
JavaScript
function fDisableSelect(pPre){
document.body.style[pPre + 'user-select'] = 'none';
}