I am modifying a small online text editor.
I have a series of dynamically generated fields: sub0 sub1 sub2 etc.

I get stuck feeding the modified data back.
subX.selection.setContent() - where X is the field number.

how can I set X as a variable?