jquery - why do we need prefix "data" for custom data attributes in html5 -


is there reason use data-attribute custom data attributes on html5 elements? remember using custom data attributes without using data prefix , think did work alright.

can please correct me.

abridged version of the answer @lachlan hunt duplicate question:

  • it guarantees there not clashes extensions html in future editions.
  • more convenient dom api accessing these attributes scripts.
  • they provide clear indication of attributes custom attributes, , ones standardised attributes.

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

asp.net core mvc - How important is the global.json and src folder? -

c++ - Using Gtest how return different values in ON_CALL? -