Web API

Custom attribute

HTML element are all just javascript objects, we can add custom attributes on it if needed.

The convention is to add ‘data-’ prefix on the attribute name.

let tagButtonsContainer = document.getElementsByClassName("tagSearch-tags");
tagButtonsContainer.searchTags = [];
🌐Check out other language versions!
Built with Hugo
Theme Stack designed by Jimmy