开发者

HTML5 - Validation messages

What element should I use to show validation开发者_StackOverflow中文版 messages (errors) to the user? Which one is more semantic in HTML5?


You could consider adding an ARIA role of 'alert' or 'status'. I don't think that semantically any of the HTML elements is any better than <div class="error">


I typically would use a div with an error or notice class to show errors.


I would use javascript to show a javascript error box containing the erro(s).

EDIT: For server side validation we use a <div> that gets filled after an ajax call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜