Ruby's Louvre

每天学习一点点算法

导航

判定是否元素节点

isDOMElement = !!(typeof HTMLElement!=='undefined'&&x instanceof HTMLElement||(typeof x==='object'&&!!x.tagName&&!(x instanceof Object)));

posted on 2011-01-08 11:49  司徒正美  阅读(937)  评论(0编辑  收藏  举报