Creating a function for random number of events

Creating a function for random number of events

Hi guys,

i have an idea of how to do this, but Im just not quite there. What im trying to do:

I have a php script that produces titles with an editing textbox accompanying each based on what is in my database.

Assume i have 3 textboxes:
TB1 - TBedit1
TB2 -TBEdit2
TB3 - TBEdit3

i have a jQuery add-in that I can make a dialog box appear, and I am trying to find a way to create a dialog div for these textboxes where if I added more to the DB later, I wouldnt have to change my JS.

All I need is a for loop where i get the class of the objects, then for each it runs through the function using the ids of the texboxes. if that makes any sense.

Something like:

Function{
var elements = getTextboxesBy ClassName;
for (){
my dialog code
}
}

Would that theoretically work? and what is the jquery to get objects by class name?