0

Is there a way to prevent from text in other elements to not get highlighted when you click rapidly? I am creating a game in HTML5 canvas which involvs clicking fast and I think it's really unprofessional and annoying if text from other elements start to get highlighted. How could I prevent this?

user2673553
  • 343
  • 5
  • 11
  • Does http://stackoverflow.com/questions/4117466/javascript-disable-text-selection-via-doubleclick answer your question? However, if there is no content where selecting would make the slightest sense use [CSS to completely disable text selection](http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting). – ThiefMaster Dec 29 '13 at 02:31
  • I can't tell what you're asking. What do you mean by "highlighted"? And what "other elements" are you talking about? – cookie monster Dec 29 '13 at 02:31
  • When you click and drag text it gets highlighted... When you double or triple click it does the same thing to text Edit: It's a good way to do it but I like KG's Way better since it's a lot less complicated. Thanks for the info though – user2673553 Dec 29 '13 at 02:32

1 Answers1

0

CSS3 selection should help you out,

::selection {
  color: #fff;
}

More here.

Index
  • 2,351
  • 3
  • 33
  • 50
  • Thanks, this is a lot less complicated than using functions. How couldn't I think of this? I'll accept your answer when it allows me :) – user2673553 Dec 29 '13 at 02:36