Javascript to pre-select textarea on page load

I have a page with a text field, when the page is loaded, I want to pre-select a text field (for example, twitter.com), so the user does not need to click on it. Do you know how to do this?

Thanks before!

Rodrigo Alves Vieira.

+4
source share
1 answer
$(document).ready(function() {
  $('#text-area-id').focus();
});

here: http://jsfiddle.net/jxrS7/

+4
source

All Articles