Hi, I would like to know how I can change the size of a div gradually with a range slider.
Thank you very much.
Hi, I would like to know how I can change the size of a div gradually with a range slider.
Thank you very much.
var range = document.getElementById("my-range");
var square = document.getElementById("square");
range.addEventListener("change", function() {
square.style.zoom = this.value;
});
#square {
margin: 20px;
background: red;
width: 50px;
height: 50px;
}
<input id="my-range" type="range" step="0.25" min="0.25" max="4" />
<div id="square"></div>