Let's say I have a bunch of arrays named a=[], b=[], c=[], d=[], and so on. A Table is shown to the client and depending on the cell that the client clicks, we do operations to the specific array made for that cell. The code explains what I mean in a better way. I would be thankful if anyone helps. HTML:
<td id="block1" class="blocks" onclick="markNLock('a',this)" onmouseover="setMouseOverColor(this)" onmouseout="setMouseOutColor(this)">
Js:
function markNLock(idx, mark) {
for(var i=0; i<Matrix.length; i++)
{
Matrix[i] += idx[i];
console.log(idx[i]);
}
}
addEventListenerinstead this problem won't happen.ainstead of"a". Problem solved