回答編集履歴

1

調整

2021/06/04 02:34

投稿

yambejp
yambejp

スコア116726

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  document.querySelectorAll('#date_link option').forEach(x=>{
10
10
 
11
- var flg=new RegExp(location.pathname).test(x.value);
11
+ var flg=location.pathname==x.value;
12
12
 
13
13
  x.selected=flg;
14
14
 
@@ -16,15 +16,7 @@
16
16
 
17
17
  });
18
18
 
19
- window.addEventListener('DOMContentLoaded', ()=>{
20
-
21
- history.pushState(null,null,'/news/date/2021/5/');
22
-
23
- });
24
-
25
19
  </script>
26
-
27
-
28
20
 
29
21
  <select id="date_link">
30
22