Incorrect error reported in Javascript

Dear W3C,

I used the HTML validator to verify the following page: 
http://spain.archill.net/verslag.php and I get the following error:

/Line 37, Column 209/: end tag for element "A" which is not open

|...g id='tn"+j+"' class='"+cn+"' src='thumbnail.php?sqz=90&img="+imgs[j]+"'></a*>*"}

|

This is in the HEAD section of the document and within <script ...><!-- 
and --></script> tags.
Why is the validator checking to-be-generated-HTML within a javascript, 
even within comment <!--/--> tags?

Thanks and regards,

Arjan den Boer

Received on Wednesday, 29 October 2014 21:06:51 UTC