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

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

WBOY
Release: 2016-06-21 09:05:16
Original
1038 people have browsed it

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];}
Copy after login


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template