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

回答編集履歴

1

コードを一部修正

2020/08/23 10:54

投稿

ex025
ex025

スコア179

answer CHANGED
@@ -5,8 +5,8 @@
5
5
  let text = document.querySelector("#textin1").value;
6
6
 
7
7
  //テキストを分割
8
- text1 = "textin1".slice(0,5);
8
+ text1 = text.slice(0,5);
9
- text2 = "textin2".slice(5,10);
9
+ text2 = text.slice(5,10);
10
10
 
11
11
  //テキストをHTMLに入れる
12
12
  document.querySelector("#textin1").innerHTML = text1;