Answers for "javascript how to add custom tag to a div"

0

create custum tage html

The document.registerElement() method is used to create a custom HTML element. This should be passed as the name of your custom element along with an (optional) object that defines the API.

var XTreehouseElement = document.registerElement('x-treehouse');
document.body.appendChild(new XTreehouseElement());

<x-treehouse></x-treehouse>
Posted by: Guest on October-19-2020

Code answers related to "javascript how to add custom tag to a div"

Browse Popular Code Answers by Language