Markup Validation Error: "Attribute name not allowed on element at this point" error #HTML5


Updated July 12, 2013 ● 3,724 views

Here is some lesson learned while building this website. After doing a markup validation service using the w3c.org service, I get a couple of errors saying "Attribute sort not allowed on element a at this point...".

I had an element like this:

<a href="javascript:void(0);" sort="best" class="btn btn-mini active">

The above attribute works and JQuery was able to get the attribute sort value. But this is not the correct way to define a custom data attribute. Custom data attribute should be prepended with "data-". Therefore, the following code should be like:

<a href="javascript:void(0);" data-sort="best" class="btn btn-mini active">

0 Comments


This website uses cookies. By continuing to use this site, you are accepting our Privacy Policy and Terms of Service.