我正在编写用户根据需要更改跨度元素顺序的代码。我需要收集跨度元素的顺序并将其放入变量中,例如,如果顺序如下所示:
<span id="span-2">[<a class="move-up">Up</a>/<a class="move-down">Down</a>]</span>
<span id="span-3">[<a class="move-up">Up</a>/<a class="move-down">Down</a>]</span>
<span id="span-5">[<a class="move-up">Up</a>/<a class="move-down">Down</a>]</span>
<span id="span-4">[<a class="move-up">Up</a>/<a class="move-down">Down</a>]</span>
<span id="span-1">[<a class="move-up">Up</a>/<a class="move-down">Down</a>]</span>
那么,变量将是“2,3,5,4,1”