What's the difference between getAttribute() and dataset for accessing data attributes?
getAttribute() works with any attribute, while dataset is specifically designed for data-* attributes and provides a more convenient interface. With dataset, data-user-name becomes dataset.userName (camelCase), while getAttribute() requires the full attribute name ('data-user-name'). dataset is more modern and provides a cleaner API for data attributes, but getAttribute() is more versatile as it works with all attributes.