sldier-vertical

PHOTO EMBED

Sat Feb 12 2022 06:10:07 GMT+0000 (Coordinated Universal Time)

Saved by @artistole #htm

<input type="range" min="0" max="100" value="50" class="vertical-sldier" id="range" />
<img src="volume_up_black_24dp.svg" id="volume-icon" />
<div id="range-value"></div>

<script>
    var slider = document.querySelector("#range");
    var output = document.querySelector("#range-value");
    
    output.innerHTML = slider.value;
    
    slider.oninput = function () {
    	output.innerHTML = this.value;
    	if (slider.value === "0") {
    		document.querySelector("#volume-icon").src = "volume_off_black_24dp.svg";
    	} else {
    		document.querySelector("#volume-icon").src = "volume_up_black_24dp.svg";
    	}
    };
    
</script>
content_copyCOPY