Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How will make the button text selectable?

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;
like image 606
Karthick Kumar Avatar asked Jun 23 '26 20:06

Karthick Kumar


1 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

like image 91
xianshenglu Avatar answered Jun 25 '26 10:06

xianshenglu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!