Re:Introducing Custom Elements
by bryanrasmussen on Monday November 21, 2016 @03:06PM
(#13008658)
Ok thanks, now I see a benefit - not sure if I consider it enough of a benefit for creating what I would consider to be awful interop problems but I can see a benefit.
With all frameworks I know of, this won't work for elements dynamically added to the DOM after the start of your application. Not only document.createElement, but even if you insert chunks of markup using innerHTML or the like.
Sometimes there is a framework-specific call to do the right thing, but then you're back to needing to know how an element is implemented.
For Custom Elements, it really is as simple as just inserting them. You don't have to run any script code to make them do what they do.