Should I make my habit of using custom tags in html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Should I make my habit of using custom tags in html?

Its really easy to write these tags but is it acceptable like for testers?

21st Nov 2017, 4:54 AM
pranit batra
pranit batra - avatar
5 Answers
+ 11
As mentioned by @Calvin it's quite common to have custom tag when working with JS framework like Angular & React to define different behaviour. Besides that I don't think we ever need it in normal web development. In the end, a tag is just a piece of markup in the document. 😉
21st Nov 2017, 8:18 AM
Zephyr Koo
Zephyr Koo - avatar
+ 7
I can not understand the benefits of using it, but anyway it serves primarily to extend the html's vocabulary. I've seen some guys using JS to create custom tags in html, but I think only with html it's possible to create. Take a look at this site: https://www.polymer-project.org/
21st Nov 2017, 5:14 AM
Malkon F
Malkon F - avatar
+ 4
From what I seen, it is just <div id=name> turned into <name>. It could make CSS and JS simpler because you could group subsets of div's in a custom using tag, class, and id syntax for the subset to customize as needed. If there were 30 divs, each might need id, class, and tag level CSS. If you organized that into 6 customs, you might get way with just tag level CSS for some.
21st Nov 2017, 5:32 AM
John Wells
John Wells - avatar
+ 4
Use custom tag with react.js components, to extends the tag functionalities.
21st Nov 2017, 6:21 AM
Calviղ
Calviղ - avatar
+ 2
There doesn't appear any detractors in stack over discussions at the moment. Doesn't mean issues won't appear once tons of usage gets out there in live sites.
21st Nov 2017, 5:07 AM
John Wells
John Wells - avatar