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

后端 未结 10 1984
说谎
说谎 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

    Note that an ID cannot start with a digit, so:

    is invalid HTML. See What are valid values for the id attribute in HTML?

    In your case, I would use ID's like thing5 or thing.5.

提交回复
热议问题