teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

appendChildの引数の間違った変数名を修正しました

2021/11/16 12:02

投稿

lkl191
lkl191

スコア14

title CHANGED
File without changes
body CHANGED
@@ -8,11 +8,11 @@
8
8
  ```
9
9
  これだとエラーは出ないのですが、
10
10
  ```
11
- document.body.appendChild(elem)
11
+ document.body.appendChild(input)
12
12
  ```
13
13
  これだとエラーが出ます。
14
14
  ```
15
- testRef.current.appendChild(elem)
15
+ testRef.current.appendChild(input)
16
16
  ```
17
17
 
18
18
  何かuseRefで定義した要素に別の要素を追加する方法はありませんか?