So any custom data attribute that I use should start with "data-":
<li class="user" data-name="John Resig" data-city="Boston"
data-lang="js" data-food="Bacon">
<b>John says:</b> <span>Hello, how are you?</span>
</li>
Will anything bad happen if I just ignore this? I.e.:
<li class="user" name="John Resig" city="Boston"
lang="js" food="Bacon">
<b>John says:</b> <span>Hello, how are you?</span>
</li>
I guess one bad thing is that my custom attributes could conflict with HTML attributes with special meanings (e.g., name
), but aside from this, is there a problem with just writing "example_text" instead of "data-example_text"? (It won't validate, but who cares?)