質問編集履歴

1

追加

2019/05/28 05:07

投稿

buk
buk

スコア53

test CHANGED
File without changes
test CHANGED
@@ -89,3 +89,79 @@
89
89
 
90
90
 
91
91
  ご教示願います。
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ 追記です。
100
+
101
+ ```ここに言語を入力
102
+
103
+ function entryChange1(){
104
+
105
+ radio = document.getElementsByName('sample')
106
+
107
+ if(radio[0].checked) {
108
+
109
+ document.getElementById('seminar-time').disabled = false;
110
+
111
+ $('#none-radio02').unwrap("<span>");
112
+
113
+
114
+
115
+ var obj = document.getElementById('seminar-time');
116
+
117
+ obj.selectedIndex = 0;
118
+
119
+ }else if(radio[1].checked) {
120
+
121
+ document.getElementById('seminar-time').disabled = false;
122
+
123
+ $('#none-radio02').wrap("<span>");
124
+
125
+ var obj = document.getElementById('seminar-time');
126
+
127
+ obj.selectedIndex = 0;
128
+
129
+ }
130
+
131
+ }
132
+
133
+
134
+
135
+ window.onload = entryChange1;
136
+
137
+ ```
138
+
139
+
140
+
141
+ 上記のようにすると
142
+
143
+ ラジオボタン「エー」を2回押してしまうと
144
+
145
+ ```ここに言語を入力
146
+
147
+ $('#none-radio02').unwrap("<span>");
148
+
149
+ ```
150
+
151
+ があるため<select>タグが消えてしまいます。
152
+
153
+ ```ここに言語を入力
154
+
155
+ <option value="" selected="selected">お選び下さい</option>
156
+
157
+ <option value="11:00~12:00">11:00~12:00</option>
158
+
159
+ <option value="14:00~15:00">14:00~15:00</option>
160
+
161
+ <option value="20:00~21:00" id="none-radio02">20:00~21:00</option>
162
+
163
+ ```
164
+
165
+
166
+
167
+ いい方法はありませんでしょうか?