I just read the following at http://w3fools.com/#html_forms:
Non-block-level elements (such as
<input>
) are not valid directly inside<form>
tags until HTML5.
I had never heard of anything along these lines, and every basic HTML tutorial I've seen seems to be just fine with putting input tags directly inside a form tag. So my question has three parts:
Yes, you can have a valid input without a form.
No, nested forms are forbidden. This means A FORM has a mandatory start tag, mandatory end tag and can contain anything in %block or SCRIPT, except other FORMs.
In HTML, <input type="button" /> is used to create buttons in an HTML form. Inside the <button> tag, you can place content like text or images. However, this is not the case with the buttons created with <input> tag. The button element has type=button as default outside the form.
1. Which of the following is not a type of attribute for input tag? Explanation: Day is not defined in the pre-defined attribute list of input tag. Week attribute defines week and year when used as attribute in input tag.
It's standards pedantics.
<form>
specifies that it may only contain block elements or <script>
. As far as what every browser in the world allows, it's fine.<form>
to not be a layout tag at all, and they want all inline elements to be contained inside a block element.<div>
, <table>
, <p>
, or some other block presentational element inside the <form>
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With