1

I'm wondering why this bit of html doesn't validate (XHTML 1.0 transitional) because of the "data" attribute. I've searched around for answers, and I'm not using the jQuery metadata plugin, if that matters.

Any way to get this to validate, or escape it so the validator doesn't see it?

<div id="home" data-image="images/water.jpg">

1 Answer 1

7

Because data attributes are part of the HTML 5 spec. Use <!DOCTYPE html> to specify the HTML 5 doctype.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.