It was possible before HTML5 to add your own attributes to HTML elements and access them using JavaScript, but if you’ve ever tried it you’ll know you can forget about getting your markup to validate. You can insert your custom web-based code into any of these elements. Done! You get paid; we donate to tech nonprofits. For example, I present the element: Live demo - hover over the bar. This example shows you how to use the extended_valid_elements option, enabling you to specify valid elements and attributes. You can use the same approach to implement any custom tag you want.

My first paragraph. More info in article. edited it to ensure you have an error-free learning experience. It brings … With Custom Elements, web developers can create new HTML tags, beef-up existing HTML tags, or extend the components other developers have authored. Basic Usage Whiteboard. Just call document.registerElement() with its tag name as the first argument.