1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

textareaの入力後の値を取得したい

Last updated at Posted at 2019-07-08
<textarea class="form-control" rows="5" id="hoge">huga</textarea>     
var hoge = $('#hoge').text(); //huga

textareaの「入力後の」値を取得したい。
text()ではデフォルト値(huga)を取得してしまった。

var hoge = $('#hoge').val(); //入力後の値

val()だと、入力後の値を取得できた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?