Custom attributes - Yea or nay?

前端 未结 14 1911
南旧
南旧 2020-11-22 03:02

Recently I have been reading more and more about people using custom attributes in their HTML tags, mainly for the purpose of embedding some extra bits of data for use in ja

14条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 03:45

    For complex web apps, I drop custom attributes all over the place.

    For more public facing pages I use the "rel" attribute and dump all my data there in JSON and then decode it with MooTools or jQuery:

    blah
    

    I'm trying to stick with HTML 5 data attribute lately just to "prepare", but it hasn't come naturally yet.

提交回复
热议问题