Home >Web Front-end >HTML Tutorial >getStyle 获取元素所绑定的css属性_html/css_WEB-ITnose

getStyle 获取元素所绑定的css属性_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:05:161041browse

function getStyle(el,cssProp){    if(el.currentStyle){   // ie        return el.currentStyle[sccProp];    }    else if(window.getComputedStyle){        return window.getComputedStyle(el)[sccProp];    }    //     return el.style[cssProp];}


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn