Skip to content
Advertisement

Keep the selection in a textarea

Can I prevent the loss of selection in the “onblur” event?

JavaScript

Advertisement

Answer

I don’t think that’s a good idea. A user with mouse in his/her hand can click anywhere on the page. If you get him/her back into the textarea, it won’t be following the principles of web accessibility.

Advertisement