←back to thread

217 points palmfacehn | 1 comments | | HN request time: 0.262s | source
Show context
EGreg ◴[] No.45107545[source]
What exactly is the point of <template> tag? Just to create document fragments? I mean that’s all you can really do with it in HTML. If you are using JS you can attach shadow dom to any element.

I guess maybe slots for web components is the other point?

replies(4): >>45107642 #>>45108238 #>>45109718 #>>45111635 #
1. Theodores ◴[] No.45108238[source]
Good question. Yes there was all that web components stuff that didn't go the HTML5 way, and the template element is definitely a child of that. Since elements that get into the spec can't be removed easily, they do get repurposed instead over time.