0

I'm unable to make this code work property. Focus is on style, because everything else is working just fine.

for (var i = 0; i < apartments.length; i++) {
 apartments[i].click(function(e){

  var popupWrap = document.getElementById('front-view');
  var popup = popupWrap.appendChild(document.createElement('div'));
  var el = document.getElementsByClassName('popup');

  popup.className = 'popup';
  popup.innerHTML = "<h4>" + this.data("id") + "</h4>";
  el.style.color = 'red';
 });
}

In console it show me this message

el.style is undefined

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Stefan
  • 627
  • 6
  • 19

0 Answers0