Dynamic text field targeting

i have 5 text boxes named input0,input1,input2…
can someone please tell me how i can target these within a “for” loop using i…kind of like:

for(i=0,i<=4;i++) {
//however i would target it, something like input+i
}