JS CSS

CREATE UNSELECTABLE TEXT IN CSS JS

(quick guide & examples)

<style> .nohigh { user-select: none; } .nohigh::selection   { background: transparent; }  </style>

CSS USER  SELECT NONE

01

 <p class="nohigh">   You shall not SELECT!  </p>

<script> var all = document. getElementsByClassName("nohigh"); for (let a of all) {   a.onselectstart = () => false; } </script>

JAVASCRIPT NO SELECT

02

 <p class="nohigh">   You shall not SELECT!  </p>