function change (input){ if(input.value && input!==''){ document.getElementById('wrapper').style.height=input.value + 'px'; } } #chartFrameWrapper{width: 100%;height: 100vh;position: relative;} #chartFrameWrapper iframe {height:100%; width: 100%; overflow: hidden; position:absolute; border: none} @media (min-width: 400px){#chartFrameWrapper{height: 70vh;}} @media (min-width: 992px){#chartFrameWrapper{height: auto;padding-bottom: 66%; min-height: 500px}}