Auto select all text with jQuery

If you’re stuck using an older version of jQuery ( < 1.9 ) and need to auto select all text in a dynamically created input field you can combine .select() with .live() to make it work.

Refer the javascript code and demo below to see it in action.

Code

Result

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly

Leave a comment

Name Notify me of replies by email.