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?
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.