質問編集履歴

1

インデントと文字数の兼ね合いでtable項目減らしました。

2020/09/24 14:02

投稿

Miii
Miii

スコア30

test CHANGED
File without changes
test CHANGED
@@ -14,737 +14,463 @@
14
14
 
15
15
  <html>
16
16
 
17
- <head>
18
-
19
- <meta charset="UTF-8">
20
-
21
- <meta name="robots" content="noindex,nofollow">
22
-
23
-
24
-
25
- <!-- ビューポートの設定 -->
26
-
27
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
28
-
29
-
30
-
31
- <!-- スタイルシートの読み込み -->
32
-
33
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
34
-
35
-
36
-
37
- <title>デモ</title>
38
-
39
-
40
-
41
- </head>
17
+ <head>
18
+
19
+ <meta charset="UTF-8">
20
+
21
+ <meta name="robots" content="noindex,nofollow">
22
+
23
+
24
+
25
+ <!-- ビューポートの設定 -->
26
+
27
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
28
+
29
+
30
+
31
+ <!-- スタイルシートの読み込み -->
32
+
33
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
34
+
35
+ <title>デモ</title>
36
+
37
+ <style>
38
+
39
+ #modal-content{
40
+
41
+ max-height: calc(100vh - 1.5em);
42
+
43
+ width:50%;
44
+
45
+ margin:1.5em auto 0;
46
+
47
+ padding:10px 20px;
48
+
49
+ border:2px solid #aaa;
50
+
51
+ background:#fff;
52
+
53
+ z-index:2;
54
+
55
+ position:fixed;
56
+
57
+ display:none;
58
+
59
+ overflow: auto;
60
+
61
+ }
62
+
63
+
64
+
65
+ .button-link{
66
+
67
+ margin-left : 60px;
68
+
69
+ text-align:center;
70
+
71
+ -moz-border-radius: 5px;
72
+
73
+ -webkit-border-radius: 5px;
74
+
75
+ border-radius: 5px;
76
+
77
+ }
78
+
79
+
80
+
81
+ .button-link:hover{
82
+
83
+ cursor:pointer;
84
+
85
+ color:#f00;
86
+
87
+ }
88
+
89
+
90
+
91
+ #modal-overlay{
92
+
93
+ z-index:1;
94
+
95
+ display:none;
96
+
97
+ position:fixed;
98
+
99
+ top:0;
100
+
101
+ left:0;
102
+
103
+ width:100%;
104
+
105
+ height:120%;
106
+
107
+ background-color:rgba(0,0,0,0.75);
108
+
109
+ }
110
+
111
+ td{
112
+
113
+ padding:5px;
114
+
115
+ }
116
+
117
+ </style>
118
+
119
+ </head>
120
+
121
+
42
122
 
43
123
  <body>
44
124
 
45
-
46
-
47
-
48
-
49
- <style>
50
-
51
- #modal-content{
52
-
53
- max-height: calc(100vh - 1.5em);
54
-
55
-
56
-
57
- width:50%;
58
-
59
- margin:1.5em auto 0;
60
-
61
- padding:10px 20px;
62
-
63
- border:2px solid #aaa;
64
-
65
- background:#fff;
66
-
67
- z-index:2;
68
-
69
- position:fixed;
70
-
71
- display:none;
72
-
73
- overflow: auto;
74
-
75
- }
76
-
77
-
78
-
79
- .button-link{
80
-
81
- margin-left : 60px;
82
-
83
- text-align:center;
84
-
85
- -moz-border-radius: 5px;
86
-
87
- -webkit-border-radius: 5px;
88
-
89
- border-radius: 5px;
90
-
91
- }
92
-
93
-
94
-
95
- .button-link:hover{
96
-
97
- cursor:pointer;
98
-
99
- color:#f00;
100
-
101
- }
102
-
103
-
104
-
105
- #modal-overlay{
106
-
107
- z-index:1;
108
-
109
- display:none;
110
-
111
- position:fixed;
112
-
113
- top:0;
114
-
115
- left:0;
116
-
117
- width:100%;
118
-
119
- height:120%;
120
-
121
- background-color:rgba(0,0,0,0.75);
122
-
123
- }
124
-
125
-
126
-
127
- </style>
128
-
129
-
130
-
131
- <h1 style="text-align:center;color:#d36015;">デモ</h1>
125
+ <h1 style="text-align:center;color:#d36015;">デモ</h1>
132
-
133
-
134
-
126
+
127
+
128
+
135
- <HR style="margin: 3em 0 ;">
129
+ <HR style="margin: 3em 0 ;">
130
+
131
+
132
+
136
-
133
+ <!-- -->
137
-
138
-
139
-
140
-
134
+
141
- <!-- ここからモーダルウィンドウ -->
135
+ <!-- ここからモーダルウィンドウ -->
142
-
143
- <div id="modal-content">
144
-
145
- <!-- -->
146
136
 
147
137
  <!-- モーダルウィンドウのコンテンツ開始 -->
148
138
 
149
- <!-- -->
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- <style>
160
-
161
- td{
162
-
163
- padding:5px;
164
-
165
- }
166
-
167
- </style>
168
-
169
-
170
-
171
-
172
-
173
- <p><a id="modal-close1" class="button-link">[閉じる]</a></p>
174
-
175
- <form name="childfrm" action="" method="post">
176
-
177
-
178
-
179
- <input id="btn4444" type="button" value="値を渡す">
180
-
181
-
182
-
183
- </form>
184
-
185
- <input type="text" id="search"> <input type="button" value="絞り込む" id="button"> <input type="button" value="すべて表示" id="button2">
186
-
187
-
188
-
189
- <p id="kekka" style="display:none;height:50px;width:300px;text-align:center;">
190
-
191
- </p>
192
-
193
- <table id="result" style="border-spacing:0;">
194
-
195
- <thead>
196
-
197
-
198
-
199
-
200
-
201
- <tr><th>✔️</th><th>列1</th><th>列2</th><th>列3</th><th>列4</th></tr>
202
-
203
- </thead>
204
-
205
-
206
-
207
-
208
-
209
- <tbody>
210
-
211
- <tr>
212
-
213
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
214
-
215
-
216
-
217
- <td>地域A</td>
218
-
219
- <td>てすとCCC</td>
220
-
221
- <td>300</td><td>1300</td>
222
-
223
- </tr>
224
-
225
- <tr>
226
-
227
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
228
-
229
- <td>地域A</td>
230
-
231
- <td>てすとBBA</td>
232
-
233
- <td>400</td><td>500</td>
234
-
235
- </tr>
236
-
237
- <tr>
238
-
239
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
240
-
241
- <td>地域A</td>
242
-
243
- <td>てすとAA</td>
244
-
245
- <td>1000</td><td>2000</td>
246
-
247
- </tr>
248
-
249
- <tr>
250
-
251
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
252
-
253
- <td>地域A</td>
254
-
255
- <td>てすとD</td>
256
-
257
- <td>2000</td><td>1000</td>
258
-
259
- </tr>
260
-
261
- <tr>
262
-
263
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
264
-
265
- <td>地域B</td>
266
-
267
- <td>てすとC</td>
268
-
269
- <td>1000</td><td>2000</td>
270
-
271
- </tr>
272
-
273
- <tr>
274
-
275
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
276
-
277
- <td>地域B</td>
278
-
279
- <td>てすとA</td>
280
-
281
- <td>1000</td><td>13000</td>
282
-
283
- </tr>
284
-
285
- <tr>
286
-
287
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
288
-
289
- <td>地域C</td>
290
-
291
- <td>てすとB</td>
292
-
293
- <td>115</td><td>600</td>
294
-
295
- </tr>
296
-
297
- <tr>
298
-
299
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
300
-
301
- <td>地域C</td>
302
-
303
- <td>てとE</td>
304
-
305
- <td>300</td>
306
-
307
- <td>400</td>
308
-
309
- </tr>
310
-
311
- <tr>
312
-
313
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
314
-
315
- <td>地域C</td>
316
-
317
- <td>てすとF</td>
318
-
319
- <td>100</td><td>200</td>
320
-
321
- </tr>
322
-
323
- <tr>
324
-
325
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
326
-
327
- <td>地域C</td>
328
-
329
- <td>てすとG</td>
330
-
331
- <td>330</td><td>255</td>
332
-
333
- </tr> <tr>
334
-
335
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
336
-
337
- <td>地域C</td>
338
-
339
- <td>てとF</td>
340
-
341
- <td>100</td><td>200</td>
342
-
343
- </tr>
344
-
345
- <tr>
346
-
347
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
348
-
349
- <td>地域C</td>
350
-
351
- <td>てとG</td>
352
-
353
- <td>130</td><td>250</td>
354
-
355
- </tr>
356
-
357
- <tr>
358
-
359
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
360
-
361
- <td>地域A</td>
362
-
363
- <td>てすとD</td>
364
-
365
- <td>2000</td><td>1000</td>
366
-
367
- </tr>
368
-
369
- <tr>
370
-
371
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
372
-
373
- <td>地域B</td>
374
-
375
- <td>てすとC</td>
376
-
377
- <td>1000</td><td>2000</td>
378
-
379
- </tr>
380
-
381
- <tr>
382
-
383
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
384
-
385
- <td>地域B</td>
386
-
387
- <td>てすとA</td>
388
-
389
- <td>1000</td><td>13000</td>
390
-
391
- </tr>
392
-
393
- <tr>
394
-
395
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
396
-
397
- <td>地域C</td>
398
-
399
- <td><label style="display:none;">地域CてすとB</label>てすとB</td>
400
-
401
- <td>115</td><td>600</td>
402
-
403
- </tr>
404
-
405
- <tr>
406
-
407
- <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
408
-
409
- <td>地域C</td>
410
-
411
- <td><label style="display:none;">地域CてすとE</label>てすとE</td>
412
-
413
- <td>300</td><td>400</td>
414
-
415
- </tr>
416
-
417
- <tr>
418
-
419
- </tbody>
420
-
421
- </table>
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
- <p><a id="modal-close2" class="button-link">[閉じる]</a></p>
448
-
449
- <!-- -->
450
-
451
- <!-- モーダルウィンドウのコンテンツ終了 -->
452
-
453
- <!-- -->
454
-
455
- </div>
456
-
457
-
458
-
459
-
460
-
461
- <p><a id="modal-open" class="button-link">クリックするとモーダルウィンドウを開きます。</a></p>
462
-
463
- <!-- ここまでモーダルウィンドウ -->
464
-
465
-
466
-
467
-
468
-
469
-
470
-
471
-
472
-
473
-
474
-
475
- <HR style="margin: 3em 0 ;">
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
- <p id="subresult1">ここに表示</p>
484
-
485
-
486
-
487
-
488
-
489
-
490
-
491
- <script>
492
-
493
-
494
-
495
- jQuery(function($){
496
-
497
-
498
-
499
- //モーダルウィンドウを出現させるクリックイベント
500
-
501
- $("#modal-open").click( function(){
502
-
503
-
504
-
505
- //キーボード操作などにより、オーバーレイが多重起動するのを防止する
506
-
507
- $( this ).blur() ; //ボタンからフォーカスを外す
508
-
509
- if( $( "#modal-overlay" )[0] ) return false ; //新しくモーダルウィンドウを起動しない (防止策1)
510
-
511
- //if($("#modal-overlay")[0]) $("#modal-overlay").remove() ; //現在のモーダルウィンドウを削除して新しく起動する (防止策2)
512
-
513
-
514
-
515
- //オーバーレイを出現させる
516
-
517
- $( "body" ).append( '<div id="modal-overlay"></div>' ) ;
518
-
519
- $( "#modal-overlay" ).fadeIn( "slow" ) ;
520
-
521
-
522
-
523
- //コンテンツをセンタリングする
524
-
525
- centeringModalSyncer() ;
526
-
527
-
528
-
529
- //コンテンツをフェードインする
530
-
531
- $( "#modal-content" ).fadeIn( "slow" ) ;
532
-
533
-
534
-
535
- //[#modal-overlay]、または[#modal-close1]や2,btn4444をクリックしたら…
536
-
537
- $( "#modal-overlay,#modal-close1,#modal-close2,#btn4444" ).unbind().click( function(){
538
-
539
-
540
-
541
- //[#modal-content]と[#modal-overlay]をフェードアウトした後に…
542
-
543
- $( "#modal-content,#modal-overlay" ).fadeOut( "slow" , function(){
544
-
545
-
546
-
547
- //[#modal-overlay]を削除する
548
-
549
- $('#modal-overlay').remove() ;
550
-
551
-
552
-
553
- } ) ;
554
-
555
-
556
-
557
- } ) ;
558
-
559
-
560
-
561
-
562
-
563
- } ) ;
564
-
565
-
566
-
567
- //リサイズされたら、センタリングをする関数[centeringModalSyncer()]を実行する
568
-
569
- $( window ).resize( centeringModalSyncer ) ;
570
-
571
-
572
-
573
- //センタリングを実行する関数
574
-
575
- function centeringModalSyncer() {
576
-
577
-
578
-
579
- //画面(ウィンドウ)の幅、高さを取得
580
-
581
- var w = $( window ).width() ;
582
-
583
- var h = $( window ).height() ;
584
-
585
-
586
-
587
- // コンテンツ(#modal-content)の幅、高さを取得
588
-
589
- // jQueryのバージョンによっては、引数[{margin:true}]を指定した時、不具合を起こします。
590
-
591
- // var cw = $( "#modal-content" ).outerWidth( {margin:true} );
592
-
593
- // var ch = $( "#modal-content" ).outerHeight( {margin:true} );
594
-
595
- var cw = $( "#modal-content" ).outerWidth();
596
-
597
- var ch = $( "#modal-content" ).outerHeight();
598
-
599
-
600
-
601
- //センタリングを実行する
602
-
603
- $( "#modal-content" ).css( {"left": ((w - cw)/2) + "px","top": ((h - ch)/2) + "px"} ) ;
604
-
605
-
606
-
607
- }
608
-
609
-
610
-
611
- } ) ;
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
- document.addEventListener("DOMContentLoaded", () => {
622
-
623
- document.querySelector("#button").addEventListener("click", ()=>{
624
-
625
- var re = new RegExp(document.querySelector('#search').value);
626
-
627
- document.querySelectorAll('#result tbody tr').forEach(el => {
628
-
629
- var txt = el.querySelectorAll("td")[1].innerHTML;
630
-
631
- var txt2 = el.querySelectorAll("td")[2].innerHTML;
632
-
633
-
634
-
635
- if(txt.match(re) == null && txt2.match(re) == null){
636
-
637
- //el.style.color = "black";
638
-
639
- el.style.display="none";
640
-
641
- }else{
642
-
643
- //el.style.color = "Red";
644
-
645
- el.style.display="table-row";
646
-
647
- }
648
-
649
- });
650
-
651
- });
652
-
653
-
654
-
655
- document.querySelector("#button2").addEventListener("click", ()=>{
656
-
657
- document.querySelector('#search').value = '';
658
-
659
- // document.querySelectorAll('#result tr').forEach(el => el.style.color = "black");
660
-
661
- document.querySelectorAll('#result tr').forEach(el => el.style.display="table-row");
662
-
663
- });
664
-
665
-
666
-
667
- document.querySelector("#btn4444").addEventListener("click", ()=>{
668
-
669
-
670
-
671
- //$("#subresult1").text(window.line);
672
-
673
-
674
-
675
- //選択
676
-
677
- function TableSelect (table, x = 1, y = 1) {
678
-
679
- let q = `tr:nth-of-type(${y}) td:nth-of-type(${x})`;
680
-
681
- return table.querySelector (q).textContent;
682
-
683
- }
684
-
685
- if(window.line==undefined){
686
-
687
- }else{
688
-
689
- //5が列4
690
-
691
- //console.log (TableSelect(document.querySelector('table'), 5, window.line+1));
692
-
693
- $("#subresult1").text(TableSelect(document.querySelector('table'), 5, window.line+1));
694
-
695
- }
696
-
697
-
698
-
699
- });
700
-
701
-
702
-
703
-
704
-
705
- $('input[type="radio"]').change(function() {
706
-
707
-
708
-
709
- //選択したvalue値を変数に格納
710
-
711
- window.line = $(this).parents('tr').index();
712
-
713
-
714
-
715
-
716
-
717
-
718
-
719
- });
720
-
721
-
722
-
723
-
724
-
725
-
726
-
727
-
728
-
729
-
730
-
731
- });
732
-
733
-
734
-
735
- </script>
736
-
737
-
738
-
739
-
740
-
741
-
742
-
743
-
744
-
745
-
746
-
747
- </body>
139
+ <!-- -->
140
+
141
+
142
+
143
+ <div id="modal-content">
144
+
145
+ <p><a id="modal-close1" class="button-link">[閉じる]</a></p>
146
+
147
+ <form name="childfrm" action="" method="post">
148
+
149
+ <input id="btn4444" type="button" value="値を渡す">
150
+
151
+ </form>
152
+
153
+ <input type="text" id="search"> <input type="button" value="絞り込む" id="button"> <input type="button" value="すべて表示" id="button2">
154
+
155
+
156
+
157
+ <p id="kekka" style="display:none;height:50px;width:300px;text-align:center;"></p>
158
+
159
+
160
+
161
+ <table id="result" style="border-spacing:0;">
162
+
163
+ <thead>
164
+
165
+ <tr><th>✔️</th><th>列1</th><th>列2</th><th>列3</th><th>列4</th></tr>
166
+
167
+ </thead>
168
+
169
+ <tbody>
170
+
171
+ <tr>
172
+
173
+ <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
174
+
175
+
176
+
177
+ <td>地域A</td>
178
+
179
+ <td>てすとCCC</td>
180
+
181
+ <td>300</td>
182
+
183
+ <td>1300</td>
184
+
185
+ </tr>
186
+
187
+ <tr>
188
+
189
+ <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
190
+
191
+ <td>地域A</td>
192
+
193
+ <td>てすとBBA</td>
194
+
195
+ <td>400</td>
196
+
197
+ <td>500</td>
198
+
199
+ </tr>
200
+
201
+ <tr>
202
+
203
+ <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
204
+
205
+ <td>地域A</td>
206
+
207
+ <td>てすとAA</td>
208
+
209
+ <td>1000</td>
210
+
211
+ <td>2000</td>
212
+
213
+ </tr>
214
+
215
+
216
+
217
+ <tr>
218
+
219
+ <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
220
+
221
+ <td>地域C</td>
222
+
223
+ <td><label style="display:none;">地域CてすとB</label>てすとB</td>
224
+
225
+ <td>115</td>
226
+
227
+ <td>600</td>
228
+
229
+ </tr>
230
+
231
+ <tr>
232
+
233
+ <td><input type="radio" name="hoge" class="hoge" value="1" /></td>
234
+
235
+ <td>地域C</td>
236
+
237
+ <td><label style="display:none;">地域CてすとE</label>てすとE</td>
238
+
239
+ <td>300</td>
240
+
241
+ <td>400</td>
242
+
243
+ </tr>
244
+
245
+ </tbody>
246
+
247
+ </table>
248
+
249
+
250
+
251
+ <p><a id="modal-close2" class="button-link">[閉じる]</a></p>
252
+
253
+ </div>
254
+
255
+ <!-- -->
256
+
257
+ <!-- モーダルウィンドウのコンテンツ終了 -->
258
+
259
+ <!-- -->
260
+
261
+
262
+
263
+
264
+
265
+ <p><a id="modal-open" class="button-link">クリックするとモーダルウィンドウを開きます。</a></p>
266
+
267
+ <!-- ここまでモーダルウィンドウ -->
268
+
269
+
270
+
271
+ <HR style="margin: 3em 0 ;">
272
+
273
+
274
+
275
+ <p id="subresult1">ここに表示</p>
276
+
277
+
278
+
279
+
280
+
281
+ <script>
282
+
283
+
284
+
285
+ jQuery(function($){
286
+
287
+ //モーダルウィンドウを出現させるクリックイベント
288
+
289
+ $("#modal-open").click( function(){
290
+
291
+ //キーボード操作などにより、オーバーレイが多重起動するのを防止する
292
+
293
+ $( this ).blur() ; //ボタンからフォーカスを外
294
+
295
+ if( $( "#modal-overlay" )[0] ) return false ; //新しくモーダルウィンドウを起動しない (防止策1)
296
+
297
+ //if($("#modal-overlay")[0]) $("#modal-overlay").remove() ; //現在のモーダルウィンドウを削除して新しく起動する (防止策2)
298
+
299
+
300
+
301
+ //オーバーレイを出現させる
302
+
303
+ $( "body" ).append( '<div id="modal-overlay"></div>' );
304
+
305
+ $( "#modal-overlay" ).fadeIn( "slow" );
306
+
307
+
308
+
309
+ //コンテンツをセンタリングする
310
+
311
+ centeringModalSyncer();
312
+
313
+
314
+
315
+ //コンテンツをフェードインする
316
+
317
+ $( "#modal-content" ).fadeIn( "slow" ) ;
318
+
319
+
320
+
321
+ //[#modal-overlay]、または[#modal-close1]や2,btn4444をクリックしたら…
322
+
323
+ $( "#modal-overlay,#modal-close1,#modal-close2,#btn4444" ).unbind().click( function(){
324
+
325
+ //[#modal-content]と[#modal-overlay]をフェードアウトした後に…
326
+
327
+ $( "#modal-content,#modal-overlay" ).fadeOut( "slow" , function(){
328
+
329
+ //[#modal-overlay]を削除
330
+
331
+ $('#modal-overlay').remove() ;
332
+
333
+ });
334
+
335
+ });
336
+
337
+ });
338
+
339
+
340
+
341
+ //リサイズされたら、センタリングをする関数[centeringModalSyncer()]を実行
342
+
343
+ $( window ).resize( centeringModalSyncer );
344
+
345
+ //センタリングを実行する関数
346
+
347
+ function centeringModalSyncer() {
348
+
349
+ //画面(ウィンドウ)の幅、高さを取得
350
+
351
+ var w = $( window ).width() ;
352
+
353
+ var h = $( window ).height() ;
354
+
355
+
356
+
357
+ // コンテンツ(#modal-content)の幅、高さを取得
358
+
359
+ // jQueryのバージョンによっては、引数[{margin:true}]を指定した時、不具合を起こします。
360
+
361
+ // var cw = $( "#modal-content" ).outerWidth( {margin:true} );
362
+
363
+ // var ch = $( "#modal-content" ).outerHeight( {margin:true} );
364
+
365
+ var cw = $( "#modal-content" ).outerWidth();
366
+
367
+ var ch = $( "#modal-content" ).outerHeight();
368
+
369
+
370
+
371
+ //センタリングを実行する
372
+
373
+ $( "#modal-content" ).css( {"left": ((w - cw)/2) + "px","top": ((h - ch)/2) + "px"} ) ;
374
+
375
+ }
376
+
377
+ });
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+ document.addEventListener("DOMContentLoaded", () => {
388
+
389
+ document.querySelector("#button").addEventListener("click", ()=>{
390
+
391
+ var re = new RegExp(document.querySelector('#search').value);
392
+
393
+ document.querySelectorAll('#result tbody tr').forEach(el => {
394
+
395
+ var txt = el.querySelectorAll("td")[1].innerHTML;
396
+
397
+ var txt2 = el.querySelectorAll("td")[2].innerHTML;
398
+
399
+
400
+
401
+ if(txt.match(re) == null && txt2.match(re) == null){
402
+
403
+ //el.style.color = "black";
404
+
405
+ el.style.display="none";
406
+
407
+ }else{
408
+
409
+ //el.style.color = "Red";
410
+
411
+ el.style.display="table-row";
412
+
413
+ }
414
+
415
+ });
416
+
417
+ });
418
+
419
+
420
+
421
+ document.querySelector("#button2").addEventListener("click", ()=>{
422
+
423
+ document.querySelector('#search').value = '';
424
+
425
+ // document.querySelectorAll('#result tr').forEach(el => el.style.color = "black");
426
+
427
+ document.querySelectorAll('#result tr').forEach(el => el.style.display="table-row");
428
+
429
+ });
430
+
431
+
432
+
433
+ document.querySelector("#btn4444").addEventListener("click", ()=>{
434
+
435
+ //$("#subresult1").text(window.line);
436
+
437
+ function TableSelect (table, x = 1, y = 1) {
438
+
439
+ let q = `tr:nth-of-type(${y}) td:nth-of-type(${x})`;
440
+
441
+ return table.querySelector (q).textContent;
442
+
443
+ }
444
+
445
+ if(window.line==undefined){
446
+
447
+ }else{
448
+
449
+ $("#subresult1").text(TableSelect(document.querySelector('table'), 5, window.line+1));
450
+
451
+ }
452
+
453
+ });
454
+
455
+
456
+
457
+ $('input[type="radio"]').change(function() {
458
+
459
+ //選択したvalue値を変数に格納
460
+
461
+ window.line = $(this).parents('tr').index();
462
+
463
+ });
464
+
465
+ });
466
+
467
+ </script>
468
+
469
+
470
+
471
+
472
+
473
+ </body>
748
474
 
749
475
  </html>
750
476