I'm working with a Backbone app written in Coffeescript. I'm trying to access the cid associated with each div in a list of divs. Each div has the same 'contact' class and cid with an associated integer value.

```
<div class="contact-list">
  <div class="contact" cid="1"></div>
  <div class="contact" cid="2"></div>
  <div class="contact" cid="3"></div>
  <div class="contact" cid="4"></div>
  <div class="contact" cid="5"></div>
</div>

```

I want to find the element with a cid of 4:

```
console.log "ALL", $('.contact')

for div in $('.contact') 
  console.log div
  console.log div.attr('cid')

```

The loop appears to break upon calling .attr(). (When I comment out the line, the code prints all 5 divs. Otherwise it prints only the first) This suggests I must be calling .attr() incorrectly?