Style userSelect Property
Style userSelect Property
The userSelect property is used to either set or return whether or not the text of an element can be selected. For example, you do not want anybody to copy your content. For this purpose, you can use this property.
Syntax:-
Its syntax is:- object.style.userSelect OR object.style.userSelect = auto | none | text | all
Return:-
Its return is:- string containing whether the text of an element can be selected
Further Explanation:-
Parameter | Description |
---|---|
auto | Text can be selected according to browser default settings. |
none | Prevent text selection. |
text | The text can be selected by a user. |
all | Text selection is made with one click instead of a double-click. |