Does using custom data attributes produce browser compatibility issues?
问题 I have to choose between custom data tags or ids. I would like to choose custom data tags, but I want to be sure that they do not cause browser compatibility issues for the most widely used browsers today. I'm using jQuery 1.6 and my particular scenario involves a situation where I need to reference a commentId for several actions. <div data-comment-id="comment-1" id="comment-1"> <a class="foo"></a> </div> It's easier to extract data tags in jQueryin: $('foo').data('commentId'); Extract a