常用方法的封装 根据类名获取DOM元素 var $$ = function (className, element) { if (document.getElementsByClassName) { return (element || document).getElementsByClassName(className); } var nodes = (element || document).getElementsByTagName('*'), elements = [], len = no…