[
{id:8,ppp:99,kk:66},
{id:0,ppp:22,kk:33}
]
转
[
{value:8,text:99},
{value:0,text:22},
]
[
{id:8,ppp:99,kk:66},
{id:0,ppp:22,kk:33}
]
转
[
{value:8,text:99},
{value:0,text:22},
]
<html>
<body>
<script type="text/javascript">
var list1 = [
{id:8,ppp:99,kk:66},
{id:0,ppp:22,kk:33}
];
list2 = [];
for (var i = 0; i < list1.length; i++)
{
var obj = { value: list1[i].id, text : list1[i].ppp };
list2.push(obj);
}
</script>
</body>
</html>