Function to change Height with errors

0
184 function bannerPrincipal(){
185     var bannerHolder = document.getElementById("banner-principal");
186     var windowSize = window.innerHeight;
187     bannerHolder.css.height == windowSize+"px";
188 }bannerPrincipal();

I'm trying to change the height of the "banner-main" div with the above code, however, the following error appears in the console:

  

Uncaught TypeError: Can not read property 'height' of undefined       at bannerPrincipal (index.php: 187)       at index.php: 188

How can I fix the problem? and what is causing it?

    
asked by anonymous 13.07.2017 / 22:49

1 answer

3
bannerHolder.css.height == windowSize + 'px';

should be

bannerHolder.style.height = windowSize + 'px';
    
13.07.2017 / 22:55