📄 xgetelementsbyattribute.js
字号:
// xGetElementsByAttribute r2, Copyright 2002-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
function xGetElementsByAttribute(sTag, sAtt, sRE, fn)
{
var a, list, found = new Array(), re = new RegExp(sRE, 'i');
list = xGetElementsByTagName(sTag);
for (var i = 0; i < list.length; ++i) {
a = list[i].getAttribute(sAtt);
if (!a) {a = list[i][sAtt];}
if (typeof(a)=='string' && a.search(re) != -1) {
found[found.length] = list[i];
if (fn) fn(list[i]);
}
}
return found;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -