I am getting one validation error due to my use of data-href=\"\" in the context of making a whole DIV clickable. The JS and HTML is below. What could I do to make this W3C
Since data-*
is part of the HTML5
specification, you need to use the html5-doctype:
Any other doctype will parse your site according to HTML4 or XMHTML-Rules, where the data-*
Attribute is invalid.
edit:
You should always start your html with the proper doctype. Since triggers standards-mode in all browser, this is "the only right way" except you really want XHTML for example (although I can't see a reason why you should).
edit2:
You might want to consider using an a
anchor-tag instead, since it already has an href and is considered to be clickable?