HTML5 custom attributes - Why would I use them?
问题 I can't seem to understand why I should be happy with HTML5 allowing custom attributes? Why would I use them? 回答1: I assume you're referencing the HTML5 [data-*] attributes. The advantage is that you can easily associate some scripting data (still semantic, but not for display) with your elements without having to insert inline javascript all over the place, and it will be valid HTML5. To do the same thing in HTML4 would require specifying a custom namespace, and add some namespaced