I bet you haven't heard of this cool HTML tag & trick!

preview_player
Показать описание
Today we're going to look at the html template tag. It's a tag that sort of does literally nothing! Meaning it makes all of the html/css/js that's inside of it do nothing, not even visible!

Learn about this fancy html tag and how you can leverage it for some fairly common use cases.

💖 SUBSCRIBE (Please) 💖

🌐 Website 🌐

📢 Social Media 📢

#html #followandrew
Рекомендации по теме
Комментарии
Автор

Nice. A small note regarding defer and type="module". They should not come together. When you declare a script as of type "module", the processing of the script contents is deferred.The charset and defer attributes have no effect according to MDN docs. Its only enough to use defer

nullzero
Автор

Genius!
You're the BEST! This was my intro to Template Tag.

gioba
Автор

Brilliant thanks! Did not know anything about the Template tag.

photoinshot
Автор

I usually use `` in js to make html then add it to innerHTML of a created element

mikaelfarro
Автор

Hello
I've made a e-commerce site on which the products section is made with template tag but unfortunately I don't know why, upon hosting on internet, the contents of the template dissappears even tho it works perfectly fine while normally...
What could be the issue...I REALLY APPRECIATE your help! 😢

Vortexo
Автор

Cool! This is supported in all browsers yeah?

MattCurney
Автор

Which performs better?
1. Innerthtml = `…`;
2. template tag or
3. your first solution with create Element, addClass…
Or it doesnt matter?

Tony.Nguyen
Автор

And if each card is different, what then? It seems redundant to me.

peterloader
Автор

I am going to suggest that the spec needs to ban outright divs as people use them in demos. The title doesn't fit the video as it goes off course about JavaScript and wasn't what I was looking for in search.

makingtheweb