Do SVG docs support custom data- attributes?

前端 未结 4 833
挽巷
挽巷 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 01:58

    data-* attributes on SVG elements are officially supported in the current draft of SVG2. See:

    • w3c/svgwg commit 1cb4ee9: Added SVGElement.dataset and allowed data-* attributes on all SVG elements.
    • ACTION-3694: Add "data-*" attributes notes to spec. (Created on: January 15, 2015)
    • RESOLUTION: We will reserve "data-*" attributes to be used in SVG content. The API for handling them is on Element. (from SVG WG Telecon on 15-Jan-2015)
    • https://lists.w3.org/Archives/Public/www-svg/2014Dec/0022.html

提交回复
热议问题