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!
網站使用 Hugo 製作
模板 StackJimmy 設計