简体   繁体   中英

Javascript to pre-select textarea on page load

I have a page that has a textarea, when the page is loaded, I want to pre-select the textarea(like twitter.com does), so the user does not have to click on it. Do you know how to do that?

Previously thanks!

Rodrigo Alves Vieira.

$(document).ready(function() {
  $('#text-area-id').focus();
});

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM