Do HTML5 custom data attributes “work” in IE 6?

后端 未结 6 1811
小鲜肉
小鲜肉 2020-11-22 06:35

Custom data attributes: http://dev.w3.org/html5/spec/Overview.html#embedding-custom-non-visible-data

When I say “work”, I mean, if I’ve got HTML like this:



        
6条回答
  •  清酒与你
    2020-11-22 06:39

    In IE6, it may not work. For reference: MSDN

    I suggest using jQuery to handle most of the cases:

    var geoff = $("#geoff").data("data-geoff");
    alert(geoff);
    

    Try this in your coding.

提交回复
热议问题