From the course: Learning Web Components

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Overview of custom elements

Overview of custom elements

From the course: Learning Web Components

Start my 1-month free trial

Overview of custom elements

- [Instructor] One of the more exciting features of web components is the ability to define entirely new HTML tags. By defining new tags that have associated functionality, you can dramatically reduce the amount of code you have to write when building your apps. And it's not hard to imagine a scenario where this ability would be immensely useful. So, let's consider an example. Now, this is a screenshot of the email composition window in Gmail and it looks pretty simple, right? It's basically a box with some edit areas for recipients and subject and the body of the text along with some button controls, but let's take a look at the source code behind this seemingly simple window. Look at how complex this HTML code is. There are multiple div tags nested inside other div tags, each with different CSS classes assigned, and this isn't even all the markup. I've collapsed several of these elements in order to make the code fit in here. And this happens pretty often in modern web development…

Contents