我有一个看起来像这样的列表:如何使用HTML列表中的链接数据填充jQuery对象?
<ul id="theLinks">
<li><a href="one.php">One</a></li>
<li><a href="two.php">Two</a></li>
<li><a href="three.php">Three</a></li>
<li><a href="four.php">Four</a></li>
</ul>
我想填充一个jQuery对象与该列表中的数据,所以它看起来是这样的:
var Links = {
'One' : 'one.php',
'Two' : 'two.php',
'Three' : 'three.php',
'Four' : 'four.php'
}
什么是最好的方法为了解决这个问题?
在此先感谢!