embedded end tag errors

Here's an issue that arose for me. When an end tag such as </style> or </a> is found in an embedded usage, as below, it flags it as an error because it found an unattached tag.

<script type="text/javascript">
if (isTouchDevice()) {
document.write( "<style type='text/css'>");
..... some stuff in here ...
document.write( '</style>");  // this flags an error
};
</script>


I can get around it by using the following hack 

<script type="text/javascript">
if (isTouchDevice()) {
document.write( "<style type='text/css'>");
..... some stuff in here ...
document.write( '<' + "/style>"); // this now works, and the page is completely functional
};
</script>


Thanks for the great validation service. I tried to donate, but ran into some odd currency issues. 
Ken

Received on Friday, 12 July 2013 06:47:16 UTC