CSS disable text selection

css

Solution

Don't apply these properties to the whole body. Move them to a class and apply that class to the elements you want to disable select:

.disable-select {
  -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;
}

Problem

Currently, I have put this in the body tag to disable text selections: ``` body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } ``` However, my `input` and `textarea` boxes are now unselectable. How can I only make these input elements selectable and the rest unselectable?

Original source

Related problems