so this slider changes the width of the iframe and I tried to add another slider to change the height of the iframe but I didn’t know what the JavaScript should be for that. So my question is how can we add another slider that can change the height of the iframe, what should the JavaScript be? This is the HTML and the JS:
let slider = document.querySelector('[type=range]')
let div = document.querySelector('#myIframe')
slider.addEventListener('input', e => {
div.style.width = e.target.value + 'px'
})
<iframe id="myIframe"></iframe>
<input type="range" min="240" max="1024" value="240" style="width:100%">
2
Answers
Here is a CSS alternative
but if you insist, just add one for the height.
I suggest to delegate from a static container
You can add id for every slider, then query the elements: