Element data values should be retrieved with .data('...') rather than .attr('data-...')