Skip to main content
HTML Validation

Non-space character inside “noscript” inside “head”.

About This HTML Issue

A <noscript> inside the <head> contains text, but there it may only hold <link>, <style> and <meta> elements.

The <head> is never rendered, so a <noscript> placed there can only change metadata, for example by loading a fallback stylesheet. Whitespace and comments are fine. Any other character counts, including &nbsp;, because a non-breaking space isn't whitespace to the HTML parser.

When JavaScript is off, the parser treats that text as the start of the page content. It closes the <noscript> and the <head> early and opens the <body> there. The text and everything after it end up in the body, which is why the validator usually follows this error with Stray end tag “noscript”, Stray end tag “head” and a complaint about a second <body> start tag. Any <meta> or <link> that comes after the <noscript> also lands in the body.

A message for visitors without JavaScript belongs in a <noscript> inside the <body>. Keep the <noscript> in the <head> for metadata only, or remove it.

Invalid example

<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
<noscript>Please enable JavaScript to use this site.</noscript>
</head>
<body>
<p>Hello</p>
</body>
</html>

Valid example

<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
<noscript>
<link rel="stylesheet" href="no-js.css">
</noscript>
</head>
<body>
<noscript>
<p>Please enable JavaScript to use this site.</p>
</noscript>
<p>Hello</p>
</body>
</html>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries