Introduction
The DOCTYPE declaration tells the web browser which version of HTML the page uses. This helps the browser show the page correctly.
Every time you create a new HTML page to make sure browsers understand it.
When you want your webpage to follow modern web standards.
To avoid browsers guessing the HTML version and possibly showing errors.
When you want consistent display across different browsers and devices.