Custom attributes in HTML correctly

Tim Wells
2 min readApr 20, 2021

When building web applications, it’s often quite useful to be able to have custom attributes on HTML tags. Custom attributes can be added to any HTML tag but there is a correct way to handle it and still maintain valid HTML. Doing this the correct way also makes it quite easy to make use of those custom attributes in Javascript code.

Photo by Christopher Robin Ebbinghaus on Unsplash

--

--

Tim Wells

Self taught software developer and photographer.