What does this mean?

Error Line 95, Column 56: end tag for "input" omitted, but OMITTAG NO was specified

  <td><input type="button" value="Add to Cart"></td**>

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Info Line 95, Column 11: start tag was here

  <td>**<**input type="button" value="Add to Cart"></td>


 I thought the element was closed properly. What am I doing wrong here?

Dani AI

Generated

Good catch by and thanks to for spotting the immediate fix. The validator message "end tag for 'input' omitted, but OMITTAG NO was specified" is the validator telling the authoring rules (the DTD/validation mode) expect a different tag syntax than the one used; in other words, the problem usually comes from mixing HTML and XML/XHTML rules. The technical root is that the input element is a void element in HTML (it never has content or an end tag), while XML/XHTML requires empty elements to be written as well-formed XML. (sw.it.aoyama.ac.jp)

Practical rules to avoid the error: pick one markup mode and stick to it. For modern HTML pages use the HTML5 doctype and HTML-style void tags (the trailing slash is optional). If the page is being served as XHTML (application/xhtml+xml) or validated against an XHTML DTD, empty elements must follow XML well-formedness (self-close or use XML empty-element syntax), and the parser/validator will enforce that. Checking the document type declaration and the HTTP Content-Type header will show which rules the validator is applying. (developer.mozilla.org)

Quick checklist (safe, minimal changes):

  • Verify the DOCTYPE; switching to HTML5 removes XHTML-only strictness:
    <!DOCTYPE html>
  • If XHTML is intended, make the document well-formed and serve with the proper MIME type.
  • Consider using a semantic <button type="button"> element for interactive controls (easier to style and more flexible than an input). (w3.org)

Final notes: run the W3C/validator after fixes to confirm no other tag mismatches, and keep markup style consistent across the site to prevent repeated validator messages.

Oh, I saw what I had wrong. I didn't close

<input type="button" value="Add to Cart" />

Oops. Sorry.

Try this:

<input type="button" value="Add to Cart" />
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.