How does a browser run HTML ?, Run HTML in the browser
What is an HTML page is an application that runs on a Browser and can interact with users. This figure shows how to run HTML in a browser: 1. A webpage is actually an HTML Document consisting of character codes in a certain format. 2. this file is composed of HTML tags, CSS styles, JS Code, and HTML tags. css and Js are various resources when loading webpages. when running a webpage on a browser, the browser first creates an HTML Context, which contains various resources used when the webpage is running. Then, the browser reads the HTML file, loads it into the memory, and parses the tag according to the syntax. During the parsing process, the browser can divide it into two types according to the tag semantics. ① The system resource type is used to describe resources such as the running parameters and style settings in the browser and runtime environment, such as JS and CSS. They are not displayed to users through the browser, but provide various resources used for webpage running in the background to the browser, in the running environment, use the user interface type to display various user interface controls (such as textbox and button) on the webpage. 4. when the browser analyzes the tag of a file, it also converts the file to the Object Model DOM (Document Object Model) that can be processed by the program code ), and create the object model in the runtime environment. DOM is a tree object model. The browser converts an HTML file into a DOM object book, and each DOM node on the object tree corresponds to a tag in the HTML file. DOM is a set of Apis provided by the browser in the HTML runtime environment for developers to control HTML files. DOM APIs are used to perform various operations on DOM nodes on the DOM object tree, will be reflected on HTML files.