回答編集履歴
1
調整
answer
CHANGED
@@ -40,4 +40,17 @@
|
|
40
40
|
<li>そ</li>
|
41
41
|
</ul>
|
42
42
|
</div>
|
43
|
+
```
|
44
|
+
あとは一発でやるならこうとか
|
45
|
+
|
46
|
+
```javascript
|
47
|
+
$(function(){
|
48
|
+
$('li').on('click',function(){
|
49
|
+
var ani=$(this).closest('div').find('li:lt('+$(this).closest('div').find('li').index(this)+')').map(function(){
|
50
|
+
return $(this).text();
|
51
|
+
}).get();
|
52
|
+
console.log(ani);
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
43
56
|
```
|