Hey there is a relatively strange problem on one part of my website. I included the part that doesn’t work anymore. Normally the button should stay at the same size and should have a dark blue color if it is clicked. But right now, it just gets a basic html button. That’s strange because a few days ago the code worked perfectly fine and I changed nothing.
var header = document.getElementById("flex-wrapper-zahlung");
var btns = header.getElementsByClassName("accordion-zahlung");
for (var y = 0; y < btns.length; y++) {
  btns[y].addEventListener("click", function() {
    var current = document.getElementsByClassName("activated");
    if (current.length > 0) {
      current[0].className = current[0].className.replace("activated", "");
    }
    this.className += "activated";
  });
}.flex-wrapper-zahlung {
  margin: 0 0 0 0;
  width: 24em;
}
.accordion-zahlung {
  display: flex;
  background-color: #ededed;
  color: black;
  cursor: pointer;
  padding: .75em;
  width: 30em;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1em;
  font-weight: 500;
  transition: 0.4s;
  margin: .5em 0 0 0;
  border-radius: .5em;
}
.activated,
.accordion-zahlung:hover {
  background-color: #092a5e;
  color: white;
}<div id="flex-wrapper-zahlung">
  <button class="accordion-zahlung"><i class="far fa-credit-card"></i>     Kreditkarte</button>
  <button class="accordion-zahlung"> <i class="fas fa-file-invoice"></i>       Lastschrift</button>
  <button class="accordion-zahlung"><i class="fab fa-paypal"></i>       PayPal</button>
  <button class="accordion-zahlung"><i class="fas fa-money-check"></i>     Rechnung</button>
</div> 
     
     
     
    