HTML /DOM-model-Basics (Global Attributes)

What is the Document Object Model

The Document Object Model (DOM) is the data representation of the objects that comprise the structure and content of a document on the web.
The DOM represents the document in a way that programming languages can interact with the page.

The HTML Dom Tree of Objects

When a web page is loaded, the browser creates a Document Object Model of the page.

The HTML DOM model is constructed as a tree of Objects:

Below are some of the most commonly used Global Operators

CLASS:
  • Specifies one or more classnames for an element (refers to a class in a style sheet).
  • Non-Unique identifier,shared by elements.
NOTE: commonly used with CSS.

ID:
Specifies a unique id for an element.
NOTE getElementById()

NAME:

The NAME attribute get’s all elements with the specified name. Non-unique identifier.

NOTE:
getElementsByName()
In HTML5, the “name” attribute is deprecated and has been replaced by the “id” attribute for many elements. Use the document.getElementById() method where it is appropriate.

STYLE:

The style attribute specifies an inline style for an element.
The style attribute will override any style set globally, e.g. styles specified in the

Given below are the various style properties, their values, and their description

See the Pen CSS-Styles by Ankit (@AnkitPathshalaCoding) on CodePen.

TAB INDEX:

The tabindex attribute specifies the tab order of an element (when the “tab” button is used for navigating).

The tabindex attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).

TITLE

The title attribute specifies extra information about an element.

The title attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).