For data- attribute, please use dataset instead of setAttribute.
Also, Wilson is working on view functions that might make this simpler.