How to make Visual Studio Handle HTML 5 Tags without warning

Viewed 12861

I have various html tags (related to jquery mobile) that Visual Studio is flagging as not valid attributes: For exmaple:

<div data-role="page" id="my_id" data-theme="b" data-position="fixed">

Gets amongst others:

Validation (XHTML 1.0 Transitional): Attribute 'data-role'
is not a valid attribute of element 'div'

As you know, data-* are valid attributes of div in HTML 5.

I'm not sure how this is validated, though I think via DTDs and xmlns, so the head of the page is the default auto generated by Visual Studio:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

I know they are only warnings, but my experience is that if you leave lots of warnings that are invalid, then all the warnings that are valid get lost in the middle.

Is there any way to tell Visual Studio that these warnings should not be shown without completely disabling html validation?

(Visual Studio 2010 if it is relevant.)

2 Answers
Related