我有这个工作:
<div data-people="australian">Australian people eats...</div> <script type="text/javascript"> alert($("[data-people=australian]").html()); </script>
但是这其他不行,我不知道如何解决:
<div id="mich">Australian people eats...</div> <script type="text/javascript"> $("#mich").data("people","australian"); alert($("[data-people=australian]").html()); </script>
为什么我无法从jQuery中设置数据 – * HTML5属性并使用它们来选择DOM对象?
很感谢