<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">If you want structured data in this attribute, why not just use JSON?</blockquote><div><br>That's an idea that crossed my mind as well. I dismissed it for a few reasons:
<br>- authors would have to entitize quotes and ampersands in their attributes, which they're not used to doing with JSON normally.<br>- evaluating it would mean:<br>var obj = eval(myelement.getAttribute("_myjson");
<br>which I don't like because I prefer to avoid eval at all costs.<br>- it further marries HTML with JavaScript, which is something I'd like to see evolve and change in the future - something else widely supported, like client-side Python is a personal dream. Also, whatever attribute also needs to have meaning (read: be easy to get to in the DOM) when your document is processed by something other than a browser, such as PHP or Java.
<br><br>You, yourself, could still format your custom data that way, but I don't think it's a great idea to spec it that way. And I guess it's already been said that changing something in the DOM a good idea for this.
<br><br>We just want to allow authors to continue to do something authors already do without making validators complain.<br><br>The idea of allowing just any attribute that starts with _ (or x_) has the best benefit - authors already do it, it's just a matter of making validators not complain.
<br></div>