githubEdit

Elements

An element is a part of a webpage. In XMLarrow-up-right and HTMLarrow-up-right, an element may contain a data item or a chunk of text or an image, or perhaps nothing. A typical element includes an opening tag with some attributesarrow-up-right, enclosed text content, and a closing tag.

Example: in <p class="nice">Hello world!</p>, '<p class="nice">' is an opening tag, 'class="nice"' is an attribute and its value, 'Hello world!' is enclosed text content, and '</p>' is a closing tag.

Elements and tagsarrow-up-right are not the same things. Tags begin or end an element in source code, whereas elements are part of the DOMarrow-up-right, the document model for displaying the page in the browserarrow-up-right.

Functions
Documentation

getElementById

getElementsById

querySelector

querySelectorAll

appendChild

insertBefore

removeChild

insertAttribute

removeAttribute

cloneNode

Last updated