Do SVG docs support custom data- attributes?

前端 未结 4 830
挽巷
挽巷 2020-11-30 01:53

In HTML5, elements can have arbitrary metadata stored in XML attributes whose names start with data- such as

. Is th

4条回答
  •  孤独总比滥情好
    2020-11-30 02:20

    The data-* attribute is part of HTML5. It’s not a generic XML attribute.

    The current SVG W3C Recommendation is SVG 1.1 (from 2011-08). It doesn’t allow this attribute, as you can check in the attributes list.

    The same is the case for the SVG 2 Working Draft (from 2012-08). Update (2015): It seems that it’s intended to support data-* attributes in SVG 2 (currently still a Working Draft).

提交回复
热议问题