Question: I got these models:

```
Person(models.Model):
    first_name = models.CharField(max_lenght=10)

Phone(models.Model):
    number = models.CharField(max_lenght=10)
    person = models.ForeignKey(Person)

```

I want to indicate which of phone numbers if proffered for each person
For now I got:

```
Person(models.Model):
    first_name = models.CharField(max_lenght=10)
    main_phone = models.OneToOneField(Phone)

Phone(models.Model):
    number = models.CharField(max_lenght=10)
    person = models.ForeignKey(Person)

```

And then filtering choices in form and validating them to make sure the Person is owner of main\_phone

It should work buts looks little "spaghetti like". So maybe you have some best practices to share?

Answer: 
Use the CSS tag selector to locate the matching element/s within the DOM:

```
$("[data-itemindex=3]")

```

You can even do some more advanced selectors using a similar syntax: 

```
[title~=flower] /* Selects all elements with a title attribute containing the word "flower" */
[lang|=en] /* Selects all elements with a lang attribute value starting with "en" */
a[src$=".pdf"] /* Selects every <a> element whose src attribute value ends with ".pdf" */
a[src^="https"] /* Selects every <a> element whose src attribute value begins with "https" */

```

[**Full documentation**](http://www.w3schools.com/cssref/css%5fselectors.asp).
You can use:

```
 $('li[data-itemindex="3"]').text();

```

or

```
 $('li[data-itemindex="3"]').html()

```

**[Working Demo](http://jsfiddle.net/88XGA/)**