This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 949 - incorrect "End tag for element"-error in JavaScript
Summary: incorrect "End tag for element"-error in JavaScript
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.6.7
Hardware: Other Windows XP
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://www.bouwgilde-zzp.net/cgi-bin/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-22 10:56 UTC by Peter Elbertse
Modified: 2004-11-22 18:53 UTC (History)
0 users

See Also:


Attachments

Description Peter Elbertse 2004-11-22 10:56:04 UTC
When a javascript string is built up with the "+"-sign, the HTML validation 
will not be done upon the complete string, but on the substrings. For this 
reason:

myHint.innerHTML     = "<center><small>" + text + "</small></center>" ;

Will result in the following errors like:

------
Line 15, column 68: end tag for element "CENTER" which is not open

... = "<center><small>" + text + "</small></center>" ;
------
Comment 1 Ville Skyttä 2004-11-22 18:53:52 UTC
The error message you cited also contains:

   "If this error occured in a script section of your document, you should
    probably read this FAQ entry."

...where "FAQ entry" is a link to
http://validator.w3.org/docs/help.html#faq-javascript