Use .attr() instead of .data()

Use .attr() instead of .data() since jQuery caches values when using
latter.