回答編集履歴

1

コード例追加

2020/03/04 04:08

投稿

Takumiboo
Takumiboo

スコア2534

test CHANGED
@@ -18,6 +18,86 @@
18
18
 
19
19
 
20
20
 
21
- ```changeItem.selectedIndex !== 0 && select2.selectedIndex !== 0```ではなくて
21
+ 上記
22
22
 
23
+ ```
24
+
25
+ changeItem.selectedIndex !== 0 && select2.selectedIndex !== 0
26
+
27
+ ```
28
+
29
+ ではなくて
30
+
31
+ ```
32
+
23
- ```select.selectedIndex !== 0 && select2.selectedIndex !== 0```では?
33
+ select.selectedIndex !== 0 && select2.selectedIndex !== 0
34
+
35
+ ```
36
+
37
+ では?
38
+
39
+
40
+
41
+ ---
42
+
43
+
44
+
45
+ 追記
46
+
47
+ 書いてみました。
48
+
49
+
50
+
51
+ ```JavaScript
52
+
53
+ function changeItem(obj){
54
+
55
+ if (select.selectedIndex === 0){
56
+
57
+ text.className = 'nomal';
58
+
59
+ ok.className = 'nomal';
60
+
61
+ }else{
62
+
63
+ text.className = `click`;
64
+
65
+ if (select2.selectedIndex !== 0){
66
+
67
+ ok.className = 'yes';
68
+
69
+ }
70
+
71
+ }
72
+
73
+ }
74
+
75
+
76
+
77
+ function changeItem2(obj){
78
+
79
+ if (select2.selectedIndex === 0){
80
+
81
+ text2.className = 'nomal';
82
+
83
+ ok.className = 'nomal';
84
+
85
+ }else{
86
+
87
+ text2.className = `click`;
88
+
89
+ if (select.selectedIndex !== 0){
90
+
91
+ ok.className = 'yes';
92
+
93
+ }
94
+
95
+ }
96
+
97
+ }
98
+
99
+ ```
100
+
101
+
102
+
103
+ ちなみに関係ないですが「ノーマル」は「normal」ですね…。