Local Weather, can't assign styles to the background images via classList.add() method [CLOSED]

Hi Guys,
I am trying to assign the styles of ‘bg’ class to the background images but it is not working.
Could someone help what’s wrong in my code?

Thanks,
Simon