views:

49

answers:

2

I saw this on a CMS(sitecore) based Asp.net 2.0 Webform based site.

<a class="boardTextLink " id="boardTextLink6" headerindex="5h">

is it semantically correct and w3c valid? Can we make and use custom attributes like this? Is it good practice?

+3  A: 

its a private made-up attribute probably placed there to be examined/used by some javascript

Scott Evernden
no it's not correct and not a good practice. This kind of markup would fail to validate.
RageZ
is it semantically correct and w3c valid? Can we make and use custom attributes like this? Is it good practice?
metal-gear-solid
+2  A: 

no it's not correct and not a good practice. This kind of markup would fail to validate

This argument was used against dojo toolkit, the JavaScript framework heavily use custom attributes for doing some automatic replacement to create widget.

more reading about the custom attribute VS class here.

I think it's kind of okay to use that for private website (CMS admin interface closed website intranet) but you should avoid it on public websites.

RageZ
+1 for giving this info
metal-gear-solid
your second link is in favor of custom attributes
metal-gear-solid
There is still a debate going around ... (like almost any new things) after depend how much you value the validation to w3c. In my opinion even if these custom attribute won't validate they are harmless, I prefer having a site with custom attributes but no old html attribute and good CSSed than the reverse case.
RageZ