100-project-100-days-website/100_projects/77-control-brightness/main.js

6 lines
234 B
JavaScript
Raw Normal View History

2023-05-09 17:41:12 +03:00
rangeInput = document.getElementById('range');
container = document.getElementsByClassName('container')[0];
rangeInput.addEventListener("change",function(){
container.style.filter = "brightness(" + rangeInput.value + "%)";
});