Question: After searching a lot on this problem, i'm askin help to the community :

I'm doing somthing like that in a View (The problem is the same if i'm using @Html.Action or a PartialView

```
@for(int i= 0; i< Model.Contacts.Count(); i++)
{
     @Html.EditorFor(m => m.Contacts[i] , "AccreditationContact" )
}

```

I have a classic EditorTemplate or PartialView like that

```
    @model FrontOffice.Models.AccreditationStepSevenModel

    <div>
        @Html.LabelFor(m => m.Nom)
        @Html.TextBoxFor(m => m.Nom)
        @Html.ValidationMessageFor(m => m.Nom)
    </div>
[There is a lots of other fields here] 

```

The html generated for the field "Nom" looks like something like that :

```
    <input id="Contacts_0__Nom" name="Contacts[0].Nom" type="text" value="Doe" > 
    <input id="Contacts_1__Nom" name="Contacts[1].Nom" type="text" value="Doe1" >
    <input id="Contacts_2__Nom" name="Contacts[2].Nom" type="text" value="Doe2" >

```

No problem here when i submit my form, all fields are correctly binded into an Array by the native ModelBinder in my controller

Now i would like to dynamically in javascript generate another AccreditationStepSevenModel, i used a $load with Jquery. The problem is that the html generated does not increment the names then i have multiple fields with the same names and my ModelBinder does not work anymore...

i thought about renaming the names in javascript, and this would work, but is there a better solution ?

Thanks for your help !

Answer: 
```
$('[id$="txt"]')

```

is the set of elements whose id ends with `txt`.

It uses the ["Attribute Ends With Selector"](http://api.jquery.com/attribute-ends-with-selector/).

The syntax is obviously inspired from regular expressions : it's the same as

```
$('*').filter(function(){ return /text$/.test(this.id) });

```

There is the symmetric selector for elements whose an attribute starts with a text and it's logically

```
$('[attributename^="txt"]')

```
You're talking about the 'ends with' selector <http://api.jquery.com/attribute-ends-with-selector/>