How will make the button text selectable?

Viewed 4445

I applied these styles to a button. but it does not work

<button type="button" name="tucson-yes" aria-live="polite" tabindex="1">HOLDIT</button>

-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
3 Answers

It seems work if you start selecting from the text. Test on win10 ChromeBeta 75.

button {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  width: 100px;
}
<button type="button" name="tucson-yes" aria-live="polite" tabindex="1">HOLDIT</button>

See my gif:

enter image description here

Wrap the button text in a div.
<button><div>button label</div><button>
worked for me

Related