Is it always bad practice to start an ID with a number? (CSS)

后端 未结 5 2017
暗喜
暗喜 2020-12-20 15:54

In my project I have submissions and comments, each with an ID. Currently the ID\'s are just numeric and correspond to their database ID\'s. Everything is working fine but w

5条回答
  •  时光说笑
    2020-12-20 16:29

    I suggest you to use prefixes "comment-ID" or "post-ID".

    If you need the id in JavaScript, you just have to id.substring(8) (for "comment-")

提交回复
热议问题