Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom attributes - Yea or nay?
    primarykey
    data
    text
    <p>Recently I have been reading more and more about people using custom attributes in their HTML tags, mainly for the purpose of embedding some extra bits of data for use in javascript code.</p> <p>I was hoping to gather some feedback on whether or not using custom attributes is a good practice, and also what some alternatives are.</p> <p>It seems like it can really simplify <em>both</em> server side and client side code, but it also isn't W3C compliant. </p> <p>Should we be making use of custom HTML attributes in our web apps? Why or why not?</p> <p>For those who think custom attributes are a good thing: what are some things to keep in mind when using them?</p> <p>For those who think custom attributes are bad thing: what alternatives do you use to accomplish something similar?</p> <p><strong>Update:</strong> I'm mostly interested in the <em>reasoning</em> behind the various methods, as well as points as to why one method is better than another. I think we can all come up with 4-5 different ways to accomplish the same thing. (hidden elements, inline scripts, extra classes, parsing info from ids, etc). </p> <p><strong>Update 2:</strong> It seems that the HTML 5 <code>data-</code> attribute feature has a lot of support here (and I tend to agree, it looks like a solid option). So far I haven't seen much in the way of rebuttals for this suggestion. Are there any issues/pitfalls to worry about using this approach? Or is it simply a 'harmless' invalidation of the current W3C specs?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload