Opinion: in HTML, Possible Duplicate IDs or Non-Standard Attributes?

后端 未结 10 1981
说谎
说谎 2020-12-17 22:49

It seems pretty common to want to let your javascript know a particular dom node corresponds to a record in the database. So, how do you do it?

One way I\'ve seen t

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 23:20

    Non-standard attributes are fine, if you're using XHTML and take the time to extend the DTD you're using to cover the new attributes. Personally, I'd just use a more unique id, like some of the other people have suggested.

提交回复
热议问题