What are good ways to set focus on textarea and move cursor to the end of its value?
-
I have a hidden textarea with have a value. When user show that textarea I want it focus and set cursor to the end of current value. I tried $('#textarea').focus() but cursor is in the beginning of value.
-
Answer:
What you want is the jCarat plugin. It lets you set carat position (among many other things). http://plugins.jquery.com/project/jCaret
Dan Ray at Quora Visit the source
Other answers
$('#textarea').selectionStart = $('#textarea').selectionEnd = $('#textarea').value.length;
George Papadakis
Related Q & A:
- What would be some good ways to advertise locally?Best solution by Yahoo! Answers
- What are good ways to save up for an iPod Touch?Best solution by wikihow.com
- What are good ways to promote my website?Best solution by Yahoo! Answers
- What are good ways to get the "Last Second Bid" on eBay successfully?Best solution by ebay.com
- What are good ways for personal fund raising?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.