DEV Community

Discussion on: My Vanilla JavaScript Built-In Web Elements Collection

Collapse
 
seanmclem profile image
Seanmclem

So it does lead to the writing last code? Less than if you were to create a class that inherits from div?

Thread Thread
 
raghavmisra profile image
Raghav Misra

When you inherit from a div, you use a div tag with the is attribute. So in this case Felippe is extending an HTMLDivElement to create his custom element. Hope that helped! This exactly confused me originally as well.