You are right:
```As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set.```