//根据Id/Class/标签获得属性集合
function getAttributeArr(type, Name, element) {
var objList;
if (type == "class") {
objList = document.getElementsByClassName(Name);
} else if (type == "name") {
objList = document.getElementsByName(Name);
}
var AttributeArr = new Array();
$.each(objList, function (i, obj) {
AttributeArr[i] = obj.getAttribute(element);
});
return AttributeArr;
}
//根据Id/Class/标签获得属性集合
function getValue(className) {
var classList = document.getElementsByClassName(className);
var valueArr = new Array();
$.each(classList, function (i, obj) {
valueArr[i] = obj.value;
});
return valueArr;
}
js+jquery批量获取指定特征元素方法
最新推荐文章于 2022-11-21 21:20:31 发布