My JavaScript is unable to get the height of a navigation object height:
<nav id="advanced-nav" class="advanced-nav menu" role="navigation">
<!-- code here -->
</nav>
The CSS for the navigation object has different heights for desktop and mobile
#advanced-nav{
height: 2em;
overflow-y: hidden;
}
@media screen and (min-width: 30em) {
#advanced-nav{
height: 10em;
}
}
My JavaScript needs to get the height of the nav object. I'm wondering why the console log is showing an empty string. How do I get the height?
const advanced_nav = document.querySelector('#advanced-nav');
console.log('height',advanced_nav.style.height);