11
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

テキストボックスの文字を全選択させる

<input type="text" id="text"/>
$('#text').on('click', function(e) {
  e.target.setSelectionRange(0, e.target.value.length);
});

iosがjQueryの.select()使えないのでこれで

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
11
Help us understand the problem. What are the problem?