in HTML by (15.1k points) edited by
0 like 0 dislike
24 views

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.1k points)

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

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

CSS:

.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.