Element

元素是網頁的一部分。在 XMLHTML 中,元素可以包含一個數據項、一段文字、一張圖片,或者什麼都沒有。一個典型的元素包括一個帶有某些 屬性 的開始標籤,其中間是文字內容,然後是一個結束標籤。

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.

元素和 標籤不是同一個東西。標籤在原始碼中開始或結束一個元素,而元素是 DOM 的一部分,DOM 是頁面在 瀏覽器 中顯示的文件模型。

另見