Why site http://xn--wiadomesny-37b.pl/test/ throws Uncaught TypeError: Cannot set property 'innerHTML' of null?
HTML (http://xn--wiadomesny-37b.pl/test/):
<div class="castle_array" id="2x1" name="2x1"></div>
<div class="castle_array" id="3x1" name="3x1"></div>
<div class="castle_array" id="4x1" name="4x1"></div>
...
JavaScript (http://xn--wiadomesny-37b.pl/test/B_modeWindow.js):
for (x = 1; x <= 5; x++) {
for (y = 1; y <= 5; y++) {
document.getElementById(x+"x"+y).addEventListener("click",B_modeWindow('1',this.id));
}}
When I alter
("click",B_modeWindow('1',this.id)
to
("click",B_modeWindow('1','string')
it works like a charm - why?