SilentHealer584
New Coder
Am I able to also change colour by sliding the same slider I use to change image size ?
Tnx a lot.
HTML:
<body>
<center>
<p><-- low temp.</p><div class="slidecontainer">
<input type="range" min="15" max="25" value="15" class="slider" id="Slider">
</div><p>high temp. --></p>
<img src="https://pngimg.com/uploads/silver/silver_PNG17187.png" id="Elon">
<script>
const slider = document.getElementById('Slider');
slider.addEventListener('input', handleChange);
function handleChange(e) {
const img = document.getElementById("Elon");
const {value, max} = e.target;
img.style.width = `${value*max}px`;
img.style.height = `${value*max}px`;
}
</script>
</center>
</body>
Tnx a lot.
Last edited by a moderator: