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

質問編集履歴

2

Colのところを変更しました。間違えました。

2021/11/13 08:56

投稿

MycoChild
MycoChild

スコア36

title CHANGED
File without changes
body CHANGED
@@ -11,7 +11,7 @@
11
11
  function changeCol(newCol){
12
12
  document.querySelectorAll('.kokowokaeru')[(num)].style.cssText = 'background-color:'+newCol+';'
13
13
  }
14
- changeFontSize((self.customCol))
14
+ changeCol((self.customCol))
15
15
  """
16
16
  let change_2 = """
17
17
  function changeFontSize(newFontSize){

1

エラーの内容を追加しました。

2021/11/13 08:56

投稿

MycoChild
MycoChild

スコア36

title CHANGED
File without changes
body CHANGED
@@ -4,18 +4,20 @@
4
4
  kokowokaeruクラスの最初の要素を変えるコード。
5
5
  return change_のときは効かなくて、return change_2のときは効きます。
6
6
  ```Swift
7
+ var customCol = "green"
8
+ var customFontSize = "100"
7
9
  func change(num: Int) -> String{
8
10
  let change_ = """
9
11
  function changeCol(newCol){
10
12
  document.querySelectorAll('.kokowokaeru')[(num)].style.cssText = 'background-color:'+newCol+';'
11
13
  }
12
- changeFontSize("yellow")
14
+ changeFontSize((self.customCol))
13
15
  """
14
16
  let change_2 = """
15
17
  function changeFontSize(newFontSize){
16
18
  document.querySelectorAll('.kokowokaeru')[(num)].style.cssText = 'font-size:'+newFontSize+'px;'
17
19
  }
18
- changeFontSize("100")
20
+ changeFontSize((self.customFontSize))
19
21
  """
20
22
  //return change_
21
23
  return change_2