About This HTML Issue
An input element cannot be placed inside a button element because the HTML standard prohibits interactive content as descendants of a button.
According to the HTML specification, interactive content (like input, button, select, etc.) must not be nested inside button elements. This restriction exists to prevent invalid or unpredictable behavior in user interfaces. For accessible and valid markup, each form control should be a separate, direct child of its container, not nested inside another interactive element.
Example of invalid HTML
<button>
Submit
<input type="text" name="example">
</button>
Correct HTML structure
<form>
<input type="text" name="example">
<button type="submit">Submit</button>
</form>
Always ensure that form elements such as input and button are not nested within each other. Keep them as siblings within a form or appropriate container.
Last reviewed: July 16, 2025
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.