DEV Community

Himanshupal0001
Himanshupal0001

Posted on

1

DOM guide for beginners #1

What is DOM?

DOM is a document object model which is created by browser while rendering html. In simple words from line <!Doctype> to </html> in a HTML file is DOM/document. It basically refer to as tree like structure of HTML. Html has a family like structure which includes ancestors, decedents, parents, children, grandchildren, great grandchildren and so on. It is used to manipulate html by js.

What are the things you should know before learning DOM?

TAG ELEMENT ATTRIBUTE NODE

TAG

<h1></h1> --------------> This is tag

ELEMENT

<h1>.....any text....</h1> ------------------> This is element

ATTRIBUTE

  • All HTML elements can have attributes
  • Attributes provide additional information about elements
  • Attributes are always specified in the start tag
  • Attributes usually come in name/value pairs like: name="value"

<a href = "google.com" height:100px width:100px></a> -----------> href, height, width is attribute.

NODE

Everything written in HTML is node.

Image description

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay