in HTML by (15.4k points) edited by
0 like 0 dislike

How I can to disable for any user to select certain element on HTML document (web page) of my site?

1 Answer

0 like 0 dislike
by (15.4k points)

For this, you can use CSS property user-select with value none:

<div class="no-select">
<!-- Content here is disabled for user selection -->


.no-select {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;

Also, you can use JS PL for it, but if user disable JS, then him can get around it.

Please log in or register to answer this question.