How to fix: Document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start tag

Most Likely Cause and Fix

Your markup contains a <input> element in a place it does not belong.

The validator is telling you that the <input> must be inside a <ins>, <del>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <div>, <address> or <fieldset> element.

What This Error Means

HTML is often comprised of elements nested inside other elements, such as the placing of an anchor within a paragraph:

<p>
    Hello <a href="http://example.com">World!</a>
</p>

There are rules regarding which elements can be nested inside other elements and when this is allowed to happen.

Most notably, block-level elements, such as <div>, are not allowed inside inline elements such as <span>.

This error relates to the when and is telling you that the <input> element on the relevant line number is not allowed unless inside a <ins>, <del>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <div>, <address> or <fieldset> element.

How To Fix It

The specific error message you encountered will refer to a line and column number. This will guide you to the exact point in your markup to which the error relates.

Find the <input> element in question and check to see what element it is inside of.

With respect to the specific portion of the document referred to by the given line and column number, the troublesome <input> must be within a <ins>, <del>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <div>, <address> or <fieldset> element.

Check that you haven't closed a <ins>, <del>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <div>, <address> or <fieldset> element too soon and make sure that the <input> is inside a <ins>, <del>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <div>, <address> or <fieldset> element as expected.

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus