Failure wiring change event handler through calculated css class

Failure wiring change event handler through calculated css class

I have a lot of textboxes in an html table.  They have the same class name if they are in the same column. But they have different class name from textboxes in other columns. So like this:

textboxes in column 1 has class Column1TextBox
textboxes in column 2 has class Column2TextBox
textboxes in column 3 has class Column3TextBox

I need to wire change event handler to each of these textboxes.  

So, I attempted to do it like so:

  1. for (var i=1; i<$('table>th').length + 1; i++)
    {
         $('input.Column' + i + 'TextBox').change(function() { alert("Hooray!" }; );
    }
It does not work. Of course simply repetitively doing the following will work, no doubt about that.

  1.  $('input.Column1TextBox').change(function() { alert("Hooray!"}; );
  2.  $('input.Column2TextBox').change(function() { alert("Hooray!"}; );
  3.  $('input.Column3TextBox').change(function() { alert("Hooray!"}; );
  4.  $('input.Column4TextBox').change(function() { alert("Hooray!"}; );
  5.  $('input.Column5TextBox').change(function() { alert("Hooray!"}; );
I am trying to be less repetitive.  Any ideas? Thanks.