I am currently working on a memory game where I have a game board populated with divs created through js
. I'm trying to add images to my array values.
Here is my array:
var memory_array = ['A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F', 'G', 'G', 'H', 'H'];
I would like to attach an image to each pair to make my project more interesting. I am currently trying
memory_array[0].style.background-image
and it is breaking my project. Any help would be greatly appreciated.