0
其裏的值保存到數組,我想OL迭代,並保存所有理成陣列如何遍歷DOM OL和使用jquery
<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*/
});
$(「#sortableAvailable li」)。each(function(){...}); – mplungjan 2013-03-03 06:46:06