Is HTML really used to use input elements without id and name attributes?

I am redesigning a site that uses inputs similar to this several times on the page:

<input type="text" name="delDate" value="06.03.2012" /> 

There is always an adjacent hidden input that gives the date entered above a specific identifier when the form is submitted, but I wonder if this does so (and throwing out # id input is a valid way of doing things, as the W3C validator does not complain about this.

Thanks for some input!

+4
source share
2 answers

Yes this is true. id attribute is not required.

+6
source

The problem with this is not that it is a reality problem, but that it creates an accessibility problem (i.e. it can confuse screen readers for disabled users). It is generally thought that it is better to have a label with an attribute for that matches the id attribute of the associated input element.

+1
source

Source: https://habr.com/ru/post/1400064/


All Articles