HTML5语法验证(HTML5 Syntax Validation)
我正在验证一些HTML,我注意到一些我不熟悉的新错误。 这些列表项根据用户输入填充JavaScript。
元素li缺少以下一个或多个属性: aria-checked , aria-expanded , aria-valuemax , aria-valuemin , aria-valuenow , aria-valuetext , role
如果有人能够对此有所了解,那就太棒了。
I was validating some HTML and I noticed some new errors that I am unfamiliar with. These list items get populated with JavaScript based on user input.
Element li is missing one or more of the following attributes: aria-checked, aria-expanded, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role
If someone could please shed some light on this, that would be great.
原文:https://stackoverflow.com/questions/16122893
更新时间:2019-12-21 14:53
最满意答案
别担心,这是一个验证器问题,如此处所述。 它应该很快修复。
Don't worry, it's a validator issue as described here. It should be fixed soon.
相关问答
我想我真正的问题是有没有从XHTML转换为HTML语法的理由? 我多年来一直在使用XHTML,并不确定是否有理由切换回来。 浏览器的兼容性(IE有时会与应用程序/ xhtml + xml mime类型配合使用)等等? 正如前面的回答所述, text/html被解析为HTML,而application/xhtml+xml被解析为XML。 因此,您应该使用与您使用的MIME类型相匹配的语法。 如果您现在正在使用text/html但使用XHTML语法,那么您应该修复您的内容以使用HTML5语法。 您可能
...
您不能触发本机验证UI,但您可以轻松地利用任意输入元素的验证API: $('input').blur(function(event) {
event.target.checkValidity();
}).bind('invalid', function(event) {
setTimeout(function() { $(event.target).focus();}, 50);
});
一旦它失去焦点,第一个事件会在每个输入元素上触发checkValidity ,如果该元素in
...
只需添加novalidate到您的
标签:如果您在TWIG中提交表单,可以使用以下内容。 {{ form(form, {'attr': {'novalidate': 'novalidate'}}) }}
Just add novalidate to your
tag:If you are rendering the form in TWIG, you can use following. {{
...
你所需要做的就是在你有[Az]的角色模式中添加一个空格。 所以它变成: pattern="[A-z ]{3,}"
希望有所帮助。 但请注意,这会阻止其他类型的空格字符。 我认为这是你想要的,因为你对字符集的其余部分的限制很大,但是值得指出的是,在上述情况下,不会破坏空格,回车和其他空格将被阻止。 如果你想允许它们,使用\s而不是仅仅一个空格:这将匹配任何空格字符。 最后,值得指出的是,即使对于普通的英文文本,标准字母表通常也是不够的。 有有效的英语单词有口音,还有撇号和其他标点符号。 你没有具体
...
别担心,这是一个验证器问题,如此处所述。 它应该很快修复。 Don't worry, it's a validator issue as described here. It should be fixed soon.
您的.html文件未被解析,这就是您在.html版本上获得错误的原因。 注意,通常PHP不会设置解析.html结束的文件(.php,.php3,.php4,.php5等等...通常,这取决于你的php.ini)。 注意 如果您正在复制/粘贴源PHP代码而不是脚本的输出(浏览器看到),这可能是您的问题(正如Jon Cram指出的那样)。 要进行浏览器内验证,请结帐: https://addons.mozilla.org/en-US/firefox/addon/html-validator/ 这通常比
...
您可以使用表单提交方法进行HTML-5验证,而不是单击“提交”按钮 $('#manageWeight-form').submit(function (e) {
e.preventDefault();
var url = '/Weight/Manage';
var data = $('#manageWeight-form').serialize();
var jqxhr = $.post(url, data, function (d) {
alert("success");
...
有可能的。 喜欢这个: HTML:
JS: function validation(_id){
var isValid= false;
//check validity here:
var el = document.getElementById(_id);
if(el.innerH
...
它不是指html5的元素id。 它与angular2严格相关,是一个模板引用变量 。 所以,正如官方文件中所述, “电话”的哈希(#)前缀表示我们正在定义一个电话变量。 在你的情况下不是“电话”,而是“heroName”。 It's not referring to the element id of html5. It's strictly related to angular2 and is a Template reference variable. So, as said in the o
...
圣牛,这一切都发生了,因为我的输入和我的标签之间有一个丢失的... Holy cow, it all happened because I had a lost
between my input and my label...