Which is more “semantic HTML” for error messages?

I believe you should use a <label> which directly associates the error message with the input element.

quoting the W3 specs

The LABEL element may be used to attach information to controls.

and

More than one LABEL may be associated with the same control by creating multiple references via the for attribute.


See also Error Message: <span> vs <label>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)