logoalt Hacker News

littlestymaaryesterday at 4:34 PM1 replyview on HN

For that to work I would need to define a custom component from JavaScript, wouldn't I? (and I thought custom components had to contain an hyphen in there name, is that wrong?)


Replies

FelipeCortezyesterday at 5:00 PM

try it!

  data:text/html,<grid><p>A</p><p>B</p><p>C</p></grid><style>grid{display: grid}</style>
afaik to create a CustomElement you need to use dashes, yes, but in this example `<grid>` is an HTMLUnknownElement, which renders just fine. some discussion here: https://stackoverflow.com/a/22545622/2393963