From the course: Vanilla JavaScript: Building on the Document Object Model (DOM)
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Parsing elements
From the course: Vanilla JavaScript: Building on the Document Object Model (DOM)
Parsing elements
- [Instructor] Now, parsing element content is the most complex task we need to do to complete our HTML parser. This is because some elements have no closed tag, some attributes have no values, and many elements have nested element content. It's this nesting that the recursive part of our recursive descent parser will handle. So once again, our development environment is very simplistic. We're going to be using the Python built-in web server. So Python dash M http server that's comes with Python three in our project folder, and we're going to be using Chrome as our browser. So you can see over here, this is the current version of the code, and I'll be using my text editor, which at the moment I'm using Atom, which I still kind of like. So in order to support element parsing, we're going to be modifying the parse loop, which is located here in the parse content function and as you can see, we're currently parsing…
Contents
-
-
-
-
Where does the DOM come from?3m 4s
-
(Locked)
DIY HTML parsing1m 21s
-
(Locked)
Building a firm foundation: The lexer14m 37s
-
(Locked)
Parsing text3m 32s
-
(Locked)
Parsing comments3m 40s
-
(Locked)
Parsing elements7m 16s
-
(Locked)
Parsing attributes7m 12s
-
(Locked)
Challenge: Void elements1m 2s
-
(Locked)
Solution: Void elements3m 3s
-
-
-