$('ul')children('li')each(function(){
var self = $(this)children('p');
var data = {
'pli_id': selfeq(0)text(),
'pli_name': selfeq(1)text(),
'pli_age': selfeq(2)text()
};
dataArraypush(data);
});
最后dataArray里面就是一个对象的数组,具体就是
[
{ pli_id: '1001', pli_name: '小强', pli_age: 13 },
{ pli_id: '1002', pli_name: '小丽', pli_age: 14 },
{ pli_id: '1003', pli_name: '小明', pli_age: 12 },
{ pli_id: '1004', pli_name: '小红', pli_age: 14 }
]不知道你这个li里面还会不会有li 所以写了两个
<script src=">li += "<li id='" + i + "' value='" + dr["cCCName"]ToString() + "' style='font-size:12px' onclick='Transfer(" + i + ")'><a href=#' >滑动门</a></li>";
function Transfer(i) {
alert(documentgetElementById(i)innerText);
}
比较简单, 用live:
$("#showtitle")live("click",function () {
var id = $("#showtitle>ul>li")attr("value");
alert(id);
});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 10 Transitional//EN" ">欢迎分享,转载请注明来源:内存溢出
评论列表(0条)