Javascript

(Javascript) Style 속성 값을 가져올 수 없다? getComputedStyle() 메소드를 사용하자

SAFE 2016. 8. 4. 10:38

window.getComputedStyle

Style 속성 값을 가져올 수 없다? getComputedStyle() 메소드를 사용하자

 

http://sean86.tistory.com/6

 

var style = window.getComputedStyle(process, null);

=======

document.getElementById("btn1").onclick = onClick

 

 

<script>

window.onload = function () {

if (!window.getComputedStyle) {

window.getComputedStyle = function(element) {

return element.currentStyle;

}

}

}

</script>