Here http://jsfiddle.net/SW5NH/5/ I created some automatically generated table (DOM + JavaScript).
I want to compare whether checkbox's Input1[z] value (true/false) is equal to Input2's[z] value. If they are not equal value[z] should change.
Tried in several ways (below the table are some test results), but can not achieve it. I would appreciate for any help/comments.
function valCheck() {
for (var y2 = 0; y2 < empl.length; y2++) {
var Id1 = 'Option1'+y2+'';
var Id2 = 'Option2'+y2;
var input1 = document.getElementById(Id1).checked;
var input2 = document.getElementById(Id2).checked;
var value = 'Value'+y2+'';
var valEntry = document.getElementById(value);
var debt = (input1==input2) ? 'no debt' : 'debt';
document.getElementById('tabinfo').innerHTML = Id1+input1+ ' ' +Id2+input2+ ' ' +(input1&&input2)+value+valEntry+ ' ' + debt;
document.getElementById(value).createTextNode(debt);
}
}
don't work
UPDATE: Solved. Solution in my last post.