It's easier to use the JavaScript `dataset` API:

```diff
 document.querySelector('.ring-display')
-  .setAttribute('data-ring-type', 'alarm');
+  .dataset.ringType = 'alarm';
```