获取目标元素所属的document对象
api的用途:获取目标元素所属的document对象。
2、ownerDocument ---返回某元素的根元素,此属性是只读的。
3、nodeType =9 文档节点
/*
*getDocument --get the document object that the target element belong to*
*@function*
*@param {HTMLElement|String} element*
*@return {HTMLElement}*
*/
ZYC.dom.getDocument = function(element){
element = ZYC.dom.g(element);
return element.nodeType == 9 ? element.ownerDocument : element.document
}