Home > Javascript > Use javascript to get element style from an external css file

<script type="text/javascript">
window.onload = function() {
var e = document.getElementById('element');
if (e.currentStyle) {
var display = e.currentStyle['display'];
} else if (window.getComputedStyle) {
var display = window.getComputedStyle(e, null).getPropertyValue('display');
}
}
</script>



Flag Counter