- 1
Insert invalid XHTML using conditional comments.Comstock/Comstock/Getty Images
Insert the offending XHTML using Internet Explorer conditional comments.
<!--[if IE]>
Place invalid XHTML for IE here
<![endif]--> - 2
Insert XHTML using JavaScript to hide it from the validator.Comstock/Comstock/Getty Images
Insert non-compliant XHTML code using the JavaScript "document.write" command or one of the HTML insertion techniques that JavaScript libraries, such as jQuery or MooTools, offer.
<script type="text/javascript">
document.write('<p>Place invalid XHTML here</p>');
</script> - 3
Create a custom DTD to force validation.Hemera Technologies/PhotoObjects.net/Getty Images
Write your own custom XHTML document type definition -- DTD -- or extend an existing doctype to fit your needs. Add the non-compliant XHTML into the file's DTD to force the XHTML validator to recognize the non-standard code.
SHARE