So I want to pass a variable like : childage_error1 childage_error2 childage_error3 etc. And I have this code right here:
for (var i = 0; i < gyermekek; i++) {
document.getElementById('gyermekkor_error' + (i + 1) + '').innerHTML = response.window['gyermekkor_error'+i+1]
}
If I put manually "gyermekkor_error1" it works but it wont work in a loop. It works in getElementById but not in the end.
var i = 1then you can just useilower down, instead ofi + 1console.log('gyermekkor_error'+i+1)should be able to quickly show you where your mistake lies. And the solution is contained in your code already as well. (Why are you doing the same thing in two different ways to begin with?)