日期:2014-05-16  浏览次数:20319 次

js方法(2)
}
if (isHtml.test(selected)) {
this[0] = selected;
this.length = 1;
return this;
}
if (reg.test(selected) || selected === "*") {
var l = this.getTagName(selected).length;
var e = this.getTagName(selected);
for (var i = 0; i < l; i++) {
this[i] = e[i];
}
this.length = e.length;
return this;
} else {
var key = selected.substring(0, selected.indexOf("["));
var attr = selected.substring(selected.indexOf("@") + 1, selected.indexOf("="));
var name = selected.substring(selected.indexOf("=") + 1, selected.indexOf("]"));
var l = this.getTagName(key).length;
var e = this.getTagName(key);
var es = [];
for (var i = 0; i < l; i++) {
if (e[i][attr] == name) {
if (e[i].checked == true) {
es.push(e[i]);
}
}
}
for (var j = 0; j < l; j++) {
this[j] = es[j];
}
this.length = es.length;
return this;
}
} else {
this.length = 0;
return this;
}
}, jquery:"1.3.2", size:function () {
return this.length;