Is it alright to add custom Html attributes?

前端 未结 11 808
醉梦人生
醉梦人生 2020-12-14 02:23

I have a site I\'m working on where I want to mark if a row of data has been changed. If something has been changed in that row I would mark it with a custom attribute like

11条回答
  •  爱一瞬间的悲伤
    2020-12-14 02:57

    Adding arbitrary attributes will mean that your HTML is no longer valid.

    If you are using XHTML, however, I think you can add attributes that have a different XML namespace, which won't cause validation problems.

    I don't know a great deal about this, but thought I'd mention it as no one else has. Perhaps someone else could expand on, or refute, this if they have a better understanding?

提交回复
热议问题