Adamsky97
Adamsky97

Reputation: 43

How to remove selection after multiple clicks?

I have some div with onclick event. After clicks in this element text from inside gets mark (selection). https://i.sstatic.net/TNyAl.jpg https://i.sstatic.net/baB0E.jpg How can I remove this?

Upvotes: 0

Views: 36

Answers (1)

metal03326
metal03326

Reputation: 1263

This is easily solvable with CSS:

.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

Then add the noselect class to the elements you don't want to be selectable.

Upvotes: 2

Related Questions