Let the storm money come!

以标签名和内容得到的DOM

      代码
function hasClass(name,type) {
var r = [];
// Locate the class name (allows for multiple class names)
var re = new RegExp("(^|\\s)" + name + "(\\s|$)");
// Limit search by type, or look through all elements
var e = document.getElementsByTagName(type || "*");
for ( var j = 0; j < e.length; j++ )
// If the element has the class, add it for return
if ( re.test(e[j]) ) r.push( e[j] );
// Return the list of matched elements
return r;
}

 

posted @ 2010-02-24 14:44  精密~顽石  阅读(194)  评论(0编辑  收藏  举报
在通往地狱的路上,加班能使你更快到达。