element.dataset in Internet Explorer

后端 未结 4 720
陌清茗
陌清茗 2021-01-06 14:45

I need a way to list the data-* attributes of an element. I would use Object.keys(element.dataset) but IE 9.0 doesn\'t have dataset s

4条回答
  •  生来不讨喜
    2021-01-06 14:58

    If you are using jQuery, you can access data-* attributes through $.data() method: http://api.jquery.com/data/

提交回复
热议问题