class attribute, you can benefit from native getElementsByClassName searching (with O(1) time complexity) and classList object for toggling, adding and removing class. There's nothing like getElementsByAttributeValue.
There is relatively slower Element.querySelectorAll('[data-attr="value"]') ref See Oliver Moran's comment. It has O(n) time complexity.