简体   繁体   中英

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

Is such html markup valid?

<icon="pen"/>

And if so, how to manage it like via jQuery ?

No, it is not valid. Don't do that.

There is a proposal for a custom elements spec, which could make icon allowable.

But following the element name with an = character is simply wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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