GeekMasher
GeekMasher

Reputation: 1086

Div's text is highlight on multiple clicks

I'm trying to stop my <div>'s text from highlighting when I click on it multiple time (it's a button). I know that there is a solution but I just don't know it. This is a simple and easy question to answer.

<div id="Button01">Time?</div>

And yes, I know it's a stupid question to ask...

Upvotes: 0

Views: 823

Answers (1)

mas-designs
mas-designs

Reputation: 7536

when it's a div it can't be a button. When you click some text multiple times is a standard behaviour the text gets highlighted.
There is some code I found on SO

div{
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

Upvotes: 2

Related Questions