AD JB Toolbox 01 EN

HTML Tutorial / Find Errors and Validate an HTML Document

HTML validation helps find markup mistakes that a browser may quietly repair, such as malformed attributes, unexpected closing tags, or duplicate IDs. After fixing reported issues, you still need to check the page's actual content and interactions in a browser.

Save and inspect the page first

Save the current HTML file and open it in a browser. Check that headings, paragraphs, links, images, and forms appear where expected. A visible page is not proof that its markup is valid: browsers can recover from some errors and display a result different from the structure you intended.

Run the Nu HTML Checker

The Nu HTML Checker can inspect a public URL, an uploaded file, or pasted markup. For a local or unpublished document, use file upload or direct input. Do not upload source files containing passwords or personal data to a public validation service.

  1. Save the latest version of the HTML file.
  2. Select the appropriate input method and start the check.
  3. Read each message and inspect the reported location plus nearby opening and closing tags.
  4. Fix the file, save it, and run the check again.

Start with the earliest error when many messages appear. A single malformed attribute can cause several later messages. The line where an error is detected may not be the line that caused it; an unclosed quotation mark, for example, can make the next tag appear invalid. Make sure you reupload the saved revision rather than repeatedly validating an older file.

For instance, this markup repeats one id:

<label for="email">Email</label>
<input id="email" name="email" type="email">
<label for="email">Confirm email</label>
<input id="email" name="email_check" type="email">

Change the second field's ID to email-check and update its label's for to match. Then check that the duplicate-ID error is gone and that each label focuses its own input. A short tag is not automatically wrong: some elements, including li in certain contexts, may omit their closing tag under HTML rules.

Validation is only one kind of check

A syntax checker cannot guarantee that a link reaches the right article, alt text explains an image, or a server handles a form correctly. Open links, use the page with a keyboard, and check a narrow viewport. For missing media, investigate paths, server responses, and supported formats as well as markup.

Know what you validated: a file upload checks that file, while a URL check inspects the document a server actually returns. On WordPress, a theme wraps the article body, so checking a manuscript fragment and checking the complete published page can produce different results. Separate problems in the article from issues introduced by the theme or a plugin.

More in This Category
HTML Tutorial / Syntax

HTML Tutorial / Syntax

Learn the essential rules of HTML syntax, including elements, tags, attributes, void elements, comments, nesting, and the structure of a complete HTML document.

HTML Tutorial / Form Structure and GET vs. POST

HTML Tutorial / Form Structure and GET vs. POST

Understand how form action, method, and control names determine where form values go, and when GET or POST is appropriate.

HTML Tutorial / Group Images and Captions with figure and figcaption

HTML Tutorial / Group Images and Captions with figure and figcaption

Use figure and figcaption to keep an image and its visible explanation together, and distinguish captions from image alt text.

HTML Tutorial / Find Errors and Validate an HTML Document

HTML Tutorial / Find Errors and Validate an HTML Document

Use the Nu HTML Checker to find markup errors, repair a duplicate ID, and supplement validation with browser and keyboard checks.

HTML Tutorial / Links: Paths, Page Fragments, and Email

HTML Tutorial / Links: Paths, Page Fragments, and Email

Create HTML links with absolute or relative URLs, jump to a document fragment, and add email, new-tab, or download links. Learn what to verify before publishing.

HTML Tutorial / Connect Labels and Inputs Correctly

HTML Tutorial / Connect Labels and Inputs Correctly

Connect labels to inputs with for and id, distinguish id from submitted name, and learn why placeholder text cannot replace a label.

HTML Tutorial / Images: img, Alt Text, and Dimensions

HTML Tutorial / Images: img, Alt Text, and Dimensions

Add an image with HTML img, write useful alternative text, and set width and height correctly. A downloadable example helps you test file paths and sizing.

HTML Tutorial / Form Validation with required, Length, and Range Limits

HTML Tutorial / Form Validation with required, Length, and Range Limits

Apply built-in required, length, and numeric constraints, test error states, and understand why server-side validation remains necessary.

HTML Tutorial / Use textarea, select, option, and button

HTML Tutorial / Use textarea, select, option, and button

Create multi-line fields, selection lists, and form buttons while understanding initial values, submitted values, and reset behavior.

HTML Tutorial / What Is HTML and What Does It Do on a Web Page?

HTML Tutorial / What Is HTML and What Does It Do on a Web Page?

HTML gives web content structure and meaning. Learn how it differs from CSS and JavaScript, see how basic markup appears in a browser, and make your first HTML file.