获取和设置目标元素的属性值
api的应用场景是:获取和设置目标元素的属性值
?
关于ZYC.dom.g的资料:http://zhangyaochun.iteye.com/blog/1439262
?
?
?
1、提供一个attribute名的转换的api
?
/**setAttr-set the attribute value for the element with the key**@function**@param {string||HTMLElement} element**@param {String} key**@param {String} value**@return {HTMLElement}**/ZYC.dom.setAttr = function(element,key,value){ element = ZYC.dom.g(element);if(key == 'style'){ element.style.cssText = value;}else{ key = ZYC.dom._NAME_ATTRS[key] || key; element.setAttribute(key,value);} return element;};??