简体   繁体   English

HTML-标签名称为属性-有效且如何使用?

[英]HTML - tag name as attribute - is valid and how to use?

Is such html markup valid? 这样的html标记有效吗?

<icon="pen"/>

And if so, how to manage it like via jQuery ? 如果是这样,如何通过jQuery进行管理?

No, it is not valid. 不,这是无效的。 Don't do that. 不要那样做

There is a proposal for a custom elements spec, which could make icon allowable. 有一个关于 自定义元素规范的建议 ,该规范可以使icon允许。

But following the element name with an = character is simply wrong. 但是在元素名称后加上=字符完全是错误的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM