I found this question on Stack Overflow, and used the code given in the top answer.
It works marvelously otherwise, but there's a kink; on my page I have multiple textareas. In fact, the selector I used was just "textarea"
.
However, when 'tabbing' from one textarea to another (using the Tab key to jump to the next one), apparently the focus event doesn't fire, and the text doesn't get selected.
How do I modify that code to work both by click, and by Tab?
JSFiddle here; http://jsfiddle.net/qQDbZ/ I'm on Chrome, and while clicking on the textarea does select all, tabbing doesn't.