当前位置: 代码迷 >> JavaScript >> js步骤(2)
  详细解决方案

js步骤(2)

热度:105   发布时间:2012-09-05 15:19:35.0
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;
  相关解决方案