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


Updated July 12, 2013 ‚óŹ 2,162 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




Our Terms of Use and Privacy Policy have changed.
By continuing to use this site, you are agreeing to the new Privacy Policy and Terms of Use.