質問編集履歴
2
補足追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -327,3 +327,97 @@
|
|
327
327
|
|
328
328
|
|
329
329
|
```
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
#補足
|
334
|
+
|
335
|
+
```js
|
336
|
+
|
337
|
+
window.addEventListener('DOMContentLoaded', ()=>{
|
338
|
+
|
339
|
+
document.querySelector('select').selected=true;
|
340
|
+
|
341
|
+
document.querySelector('#set').addEventListener('click',e=>{
|
342
|
+
|
343
|
+
e.preventDefault();
|
344
|
+
|
345
|
+
var fuga=document.querySelector('select');
|
346
|
+
|
347
|
+
document.cookie="fuga="+fuga.value+";max-age=573500000";
|
348
|
+
|
349
|
+
return false;
|
350
|
+
|
351
|
+
});
|
352
|
+
|
353
|
+
});
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
$(function(){
|
360
|
+
|
361
|
+
$('#modal_set').on('click',function(){
|
362
|
+
|
363
|
+
document.cookie="fuga=aaa";
|
364
|
+
|
365
|
+
return false;
|
366
|
+
|
367
|
+
});
|
368
|
+
|
369
|
+
});
|
370
|
+
|
371
|
+
```
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
↑でfugaを数字→aaa→数字と更新できるのですが、
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
```js
|
380
|
+
|
381
|
+
window.addEventListener('DOMContentLoaded', ()=>{
|
382
|
+
|
383
|
+
document.querySelector('select').selected=true;
|
384
|
+
|
385
|
+
document.querySelector('#set').addEventListener('click',e=>{
|
386
|
+
|
387
|
+
e.preventDefault();
|
388
|
+
|
389
|
+
var fuga=document.querySelector('select');
|
390
|
+
|
391
|
+
document.cookie="fuga="+fuga.value+";max-age=573500000";
|
392
|
+
|
393
|
+
return false;
|
394
|
+
|
395
|
+
});
|
396
|
+
|
397
|
+
});
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
$(function(){
|
404
|
+
|
405
|
+
$('#modal_set').on('click',function(){
|
406
|
+
|
407
|
+
document.querySelector('select').selected=true;
|
408
|
+
|
409
|
+
var fuga=document.querySelector('select');
|
410
|
+
|
411
|
+
document.cookie="fuga="+fuga.value+";max-age=573500000";
|
412
|
+
|
413
|
+
return false;
|
414
|
+
|
415
|
+
});
|
416
|
+
|
417
|
+
});
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
```
|
422
|
+
|
423
|
+
↑だと更新されません
|
1
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -253,3 +253,77 @@
|
|
253
253
|
|
254
254
|
|
255
255
|
```
|
256
|
+
|
257
|
+
↓dialog_test.html↓
|
258
|
+
|
259
|
+
```html
|
260
|
+
|
261
|
+
<div class="modal test-modal">
|
262
|
+
|
263
|
+
<div class="modal__bg test-modal-close"></div>
|
264
|
+
|
265
|
+
<div class="modal__content">
|
266
|
+
|
267
|
+
<select class="" name="fuga" id="hoge">
|
268
|
+
|
269
|
+
<option value="0" name="fuga"<?=$selected["0"];?>>0:00</option>
|
270
|
+
|
271
|
+
<option value="1" name="fuga"<?=$selected["1"];?>>1:00</option>
|
272
|
+
|
273
|
+
<option value="2" name="fuga"<?=$selected["2"];?>>2:00</option>
|
274
|
+
|
275
|
+
<option value="3" name="fuga"<?=$selected["3"];?>>3:00</option>
|
276
|
+
|
277
|
+
<option value="4" name="fuga"<?=$selected["4"];?>>4:00</option>
|
278
|
+
|
279
|
+
<option value="5" name="fuga"<?=$selected["5"];?>>5:00</option>
|
280
|
+
|
281
|
+
<option value="6" name="fuga"<?=$selected["6"];?>>6:00</option>
|
282
|
+
|
283
|
+
<option value="7" name="fuga"<?=$selected["7"];?>>7:00</option>
|
284
|
+
|
285
|
+
<option value="8" name="fuga"<?=$selected["8"];?>>8:00</option>
|
286
|
+
|
287
|
+
<option value="9" name="fuga"<?=$selected["9"];?>>9:00</option>
|
288
|
+
|
289
|
+
<option value="10" name="fuga"<?=$selected["10"];?>>10:00</option>
|
290
|
+
|
291
|
+
<option value="11" name="fuga"<?=$selected["11"];?>>11:00</option>
|
292
|
+
|
293
|
+
<option value="12" name="fuga"<?=$selected["12"];?>>12:00</option>
|
294
|
+
|
295
|
+
<option value="13" name="fuga"<?=$selected["13"];?>>13:00</option>
|
296
|
+
|
297
|
+
<option value="14" name="fuga"<?=$selected["14"];?>>14:00</option>
|
298
|
+
|
299
|
+
<option value="15" name="fuga"<?=$selected["15"];?>>15:00</option>
|
300
|
+
|
301
|
+
<option value="16" name="fuga"<?=$selected["16"];?>>16:00</option>
|
302
|
+
|
303
|
+
<option value="17" name="fuga"<?=$selected["17"];?>>17:00</option>
|
304
|
+
|
305
|
+
<option value="18" name="fuga"<?=$selected["18"];?>>18:00</option>
|
306
|
+
|
307
|
+
<option value="19" name="fuga"<?=$selected["19"];?>>19:00</option>
|
308
|
+
|
309
|
+
<option value="20" name="fuga"<?=$selected["20"];?>>20:00</option>
|
310
|
+
|
311
|
+
<option value="21" name="fuga"<?=$selected["21"];?>>21:00</option>
|
312
|
+
|
313
|
+
<option value="22" name="fuga"<?=$selected["22"];?>>22:00</option>
|
314
|
+
|
315
|
+
<option value="23" name="fuga"<?=$selected["23"];?>>23:00</option>
|
316
|
+
|
317
|
+
</select><br><br>
|
318
|
+
|
319
|
+
<a class="test-modal-set" href="" id="set2">設定</a><br>
|
320
|
+
|
321
|
+
<a class="test-modal-close" href="" >閉じる</a>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
```
|