Reputation: 4492
I'm trying to have all the contents in a textarea highlight when it gains focus. Currently, as soon as it gains focus the contents will be highlighted but it immediately loses it.
This is what I'm using:
<textarea onfocus="this.select()" readonly>Test</textarea>
Fiddle: http://jsfiddle.net/spedwards/Mr2ja/
Upvotes: 2
Views: 557