A Semantic HTML element generally describes its meaning to both the browser and the developer. HTML contains both semantic and non-semantic elements.
Non-semantic elements are the one that doesn’t specify any meaning about its content
Semantic elements on the other hand specify the meaning of their content.
<article> <aside> <details> <figure> <figcaption> <footer> <header>
<main> <nav> <section> <summary> <time> <h1>...<h6>
Some of the benefits from writing semantic markup are as follows:
DOM represents a logical tree and each branch of the tree ends with a node which in turn contains an object within each node. DOM methods allow programmatical access to the tree that can be used to change the document structure, style, or content. …
HTML is HyperText Markup Language and not a programming language. So what is the key difference between a markup language and a programming language? The main difference between markup language and programming language is that a markup language defines a set of rules for encoding documents in a format that is both human-readable and machine-readable while a programming language provides a set of commands and syntax that can be used to write computer programs which are understood by the computer. Basically, HTML consists of series of elements with opening and closing tags that might wrap the content and behave accordingly.