We have list in html:
<ul class="list">
<li>some text<li>
<li>some text<li>
<li>some text<li>
<li>some text<li>
<li>some text<li>
...
<li>some text<li>
</ul>
There can be more than 100 <li>
How to do:
1) Add for each <li>
id with number, like:
<li id="item1">some text<li>
<li id="item2">some text<li>
...
<li id="item200">some text<li>
and so on, to the end.
2) Count all <li>
inside <ul class="list">
3) After second step, if there are more than 60 <li>
, add their IDs (item number) to array 1, all other's <li>
IDs add to array 2 (from 60 to the end, from 60 to 500 if there are 500 <li>
).
Thanks!