3 ms·
> But WebComponents aren't "new elements." How so? What's the difference? Just like native elements, Custom Elements work with any modern framework. You can j
by ahoge 11y ago
> But WebComponents aren't "new elements."
How so? What's the difference?
Just like native elements, Custom Elements work with any modern framework. You can just add them to the DOM and they will work fine. They have their own attributes and methods. They also can fire events and react to attribute changes.
> It's more like being able to call a function and return an XML subtree.
It's not like that. You just use your Custom Element like any other element. If you want a "video" element, you add a "video" element. If you want a "my-video" element, you add a "my-video" element.
You'd interact with this "my-video" element the same way as you would with a "video" element. All the DOM/event stuff works exactly the same.