我想迭代 ol 并将所有 li 保存到数组中
<ol id="sortableAvailable">
<li id="1"><a href="" >Foo 1</a></li>
<li id="2"><a href="" >Foo 2</a></li>
<li id="3"><a href="" >Foo 3</a></li>
<li id="4"><a href="" >Foo 4</a></li>
</ol>
js应该是这样的:
var testInfoList = {};
testInfoList.ConfiguredTests = [];
/* some iteration that do the following */
testInfoList.ConfiguredTests.push({
ID: /*here i want the ID*/,
Value: /*here i want the value*/
});