put dinamic value in a []
quotes instead .
console.log(document.calculate[$(this.count)].value);
put dinamic value in a []
quotes instead .
console.log(document.calculate[$(this.count)].value);
for (let i = 1; i<=2; i++) {
let count = String("q" + i);
console.log(document.calculate.$(this[count]).value);
}
Currently I’m trying out some html and js stuff.
I have trouble using a changing string inside a command with some “.” in it.
for (let i = 1; i <= 2; i++) {
let count = String("q" + i);
console.log(document.calculate.$(this.count).value);
}
So the String “count” is changing and I want the different values of my document with the names “q1”, “q2″…
Would be awesome if someone could help me.
Thank You!
Thanks. That worked 🙂