# Ancestor

An ancestor is a programming term when dealing with hierarchical documents, such as HTML…

## What is an **Ancestor**?

An **ancestor** is a programming term when 
dealing with hierarchical documents, such as 
HTML, XML and the DOM.

HTML elements in an HMTL tree (like a person 
in a family tree) can be a **parent** or **child**.

A parent element can have *children*, but the 
can also have *grandchildren* or more. 
Those are called descendents.

A child element can have *parents* and 
*grandparents* and beyond. Those are called
**ancestors**.

Level: Apprentice · [More HTML terms at this level](https://www.ask-codey.com/glossary/subjects/html/apprentice)

Updated: September 19, 2026

Source: https://www.ask-codey.com/glossary/ancestor
