in HTML by (14.5k 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 (14.5k 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.

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.