The example in this article describes how JS operates HTML custom attributes. Share it with everyone for your reference. The details are as follows:
The HTML code is as follows (displayName is a custom attribute):
Get custom attribute value:
Set custom attribute value:
I hope this article will be helpful to everyone’s JavaScript programming design.