回答編集履歴

1

chousei

2019/08/06 07:28

投稿

yambejp
yambejp

スコア114876

test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  var flg2=document.querySelector('#f1 [type=checkbox]:checked')!==null;
16
16
 
17
- console.log([flg1,flg2,flg1&&flg2]);
17
+ // console.log([flg1,flg2,flg1&&flg2]);
18
18
 
19
19
  document.querySelector('#s1').disabled=!(flg1&&flg2);
20
20
 
@@ -69,3 +69,33 @@
69
69
  </form>
70
70
 
71
71
  ```
72
+
73
+
74
+
75
+ # IE対応
76
+
77
+ IEは次第に動かないものが増えていきます
78
+
79
+ とりあえず対応版だけあげておきます。
80
+
81
+ ```javascript
82
+
83
+ window.addEventListener('DOMContentLoaded', function(){
84
+
85
+ [].forEach.call(document.querySelectorAll('#f1 input'),function(x){
86
+
87
+ x.addEventListener('change',function(){
88
+
89
+ var flg1=document.querySelector('#f1 [type=radio]:checked')!==null;
90
+
91
+ var flg2=document.querySelector('#f1 [type=checkbox]:checked')!==null;
92
+
93
+ document.querySelector('#s1').disabled=!(flg1&&flg2);
94
+
95
+ });
96
+
97
+ });
98
+
99
+ });
100
+
101
+ ```