Because they're not standard HTML attributes, you can't set them using dot notation. You have to use setAttribute.
This is not right. You can always use the dataset attribute, which is a named set, and use the array notation to set the value you want to set. Example:
There is an error in the section When to use setAttribute instead of dot notation?, you mention the case of
data-
attributes:This is not right. You can always use the
dataset
attribute, which is a named set, and use the array notation to set the value you want to set. Example:See the documentation here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset