Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

i can not get the element height in javascript

$
0
0

here is my html code HTML

<div class="section s1">
    <div class="background" id="bgimage">
       .......
    </div>
</div>

CSS

.background {
    width: 100%;
    height: 500vh;
}

JavaScript

var background = document.getElementById('bgimage');
console.log(background.style.height);

but it brings nothing. i can not get the height of my element. it just brings an empty space in console of my browser


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>