I guess this code came from the haida prototype. I'm open to using either, though using getAttribute is more performant than accessing dataset.