Hi im trying to auto scale the bottom of my buttons
but i only get the error message
TypeError: backward.style is undefined
In a other function where i change left it works perfect...
function buttonAutoHeight() {
var clientHeight = document.getElementById('sliderContainer').clientHeight;
console.log("Die höhe des Sliders ist: " + clientHeight);
autoBottom = clientHeight / 2 - 20;
var backward = document.getElementsByClassName("backward");
var forward = document.getElementsByClassName("forward");
console.log(backward);
console.log(forward);
backward.style.bottom = autoBottom + 'px';
forward.style.bottom = autoBottom + 'px';
}
buttonAutoHeight();
<div id="sliderContainer">
<div class="backward"></div>
<div class="forward"></div>
<div id="sliderWrapper" class="slider">
<div id="slide1" class="slider">
<img src="img/clouds-2517653_1920.jpg" />
</div>
<div id="slide2" class="slider">
<img src="img/drop-of-water-2396748_1920.jpg" />
</div>
</div>
</div>