1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 <Script>7 8 /*9 *Ten * JavaScript is divided into three sections: One * ECMAScript Standard: The basic syntax of JS A * Dom:document Object Model---> Document object models----elements of the action page - * Bom:browser Object Model-----> Browser Object Models---operation is browser - * the * DOM: Document Object Model - * - * Document: Consider an HTML file as a document, because everything is the object, so the document as an object - * An XML file can also be viewed as a document + * - * HTML: Display information, display the data + * XML: Focus on storing data A * HTML file as a document, then this document as an object, all the tags in the document can be regarded as an object at * - * Each tab in the page is an element, and each element can be viewed as an object - * Tags can be nested, labels have tags, elements have elements - * - * The HTML page has a root tag--html--also called the root element - * in * The page has a root element (tag--html), there are many elements (there are many tags, there are many objects) - * to * Document: A page is a document + * - * element: All tags on the page are elements, and elements can be viewed as objects the * * * Node: All the content on the page is a node: tags, properties, text $ * Root: RootPanax Notoginseng * - * the * page is document--document, there is a root element in the document: HTML + * HTML--->head A *------>body---> Other tags the * + * A tree chart, called a tree (DOM tree), consisting of all the elements (tags) in the document and the document - * $ * */ $ - </Script> - </Head> the <Body> - Wuyi </Body> the </HTML>
The concept and role of DOM in JavaScript