回答編集履歴

1

if文の括弧が2重になっている、コメントが途切れている

2018/06/05 08:37

投稿

de9
de9

スコア312

test CHANGED
@@ -24,11 +24,11 @@
24
24
 
25
25
  function changeBackColor(){
26
26
 
27
- var myp = document.cookie; // mypにクッキーの内容を
27
+ var myp = document.cookie; // mypにクッキーの内容を代入
28
28
 
29
29
  var elements = document.getElementsByClassName('c');
30
30
 
31
- if((myp == 'red')) { // =は代入。等価演算子は==
31
+ if(myp == 'red') { // =は代入。等価演算子は==
32
32
 
33
33
  for(i=0;i<elements.length;i++){
34
34
 
@@ -36,7 +36,7 @@
36
36
 
37
37
  }
38
38
 
39
- } else if((myp == 'blue')) { // =は代入。等価演算子は==
39
+ } else if(myp == 'blue') { // =は代入。等価演算子は==
40
40
 
41
41
  for(i=0;i<elements.length;i++){
42
42