js 从一个对象中找到属性值相等的集合

mac2022-06-30  18

getobjs: function(objs, key, value) { var result = []; for (var i in objs) { var obj = $(objs[i]); if (obj.attr(key) == value) { result.push(obj[0]); } } return result; }

getobjs(obj,key,value)

更多专业前端知识,请上 【猿2048】www.mk2048.com
最新回复(0)