You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered: