回答編集履歴

1

チョウセイ

2019/10/07 03:41

投稿

yambejp
yambejp

スコア114829

test CHANGED
@@ -15,3 +15,33 @@
15
15
  ```
16
16
 
17
17
  ではダメですか?
18
+
19
+
20
+
21
+ # sample
22
+
23
+ ```javascript
24
+
25
+ <script>
26
+
27
+ $(function(){
28
+
29
+ $('[id^=like_result]').map(function(){
30
+
31
+ return parseInt($(this).attr('id').replace(/^like_result/g,''));
32
+
33
+ }).get().sort((x,y)=>-x+y).forEach(x=>$('#like_result'+x).attr('id','like_result'+(x+1).toString()));
34
+
35
+ });
36
+
37
+ </script>
38
+
39
+
40
+
41
+ <p id="like_result9">test9</p>
42
+
43
+ <p id="like_result10">test10</p>
44
+
45
+ <p id="like_result11">test11</p>
46
+
47
+ ```