开发者

Javascript to pre-select textarea on page load

开发者 https://www.devze.com 2023-01-14 17:29 出处:网络
I have a page that has a textarea, when the page is loaded, I want to pre-select the textarea(like twitter.com d开发者_JAVA技巧oes), so the user does not have to click on it. Do you know how to do tha

I have a page that has a textarea, when the page is loaded, I want to pre-select the textarea(like twitter.com d开发者_JAVA技巧oes), 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/

0

精彩评论

暂无评论...
验证码 换一张
取 消