how to change height of embedded iframe with js

Viewed 30

I have tried multiple things to try and change the height of the iframe but it automatically adds or changes the height when i click on something in the iframe.

Ive tried

    <script>
      window.addEventListener('load', (event) => {
      console.log('page is fully loaded');
      document.getElementById("FairsailApplicantPortalIframe").scrolling = "yes";
      document.getElementById("FairsailApplicantPortalIframe").removeAttribute('style');
    });
  </script>

Ive also tried

document.getElementById("FairsailApplicantPortalIframe").style = "height: 100%";
document.getElementById("FairsailApplicantPortalIframe").style.removeProperty('height');

I have css in which i want to keep the height at

    #FairsailApplicantPortal {
        height:800px;
        min-height: 1200px;
        max-height: 1600px;
    }
0 Answers
Related