Skip to main content

HTML Guide

Bad value X for attribute “src” on element “script”: Illegal character in query: “"” is not allowed.

There is an illegal double quote character (") at the end of the src attribute value in your <script> tag, which causes the attribute to be invalid.

Attribute values must not include unescaped or stray quote characters (" or ') inside them, as this breaks attribute parsing and results in invalid HTML. The src attribute for a <script> tag should contain a properly encoded URL without any stray quotes or illegal characters. In your case, a double quote has accidentally been included before the closing quote of the attribute.

Correct usage for a <script> tag with the async attribute is:

<script src="https://example.com/js/jquery-3.6.0.min.js?ver=6.8.2" async></script>

Incorrect example with the error (shows the issue):

<script src="https://example.com/js/jquery-3.6.0.min.js?ver=6.8.2" async""></script>

Make sure there are no stray characters in your attribute values and that boolean attributes like async do not have values—it should simply be present, as in async, not async"" or async="async".

If you need a full, minimal HTML document to validate, use:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Valid Script Tag Example</title>
  </head>
  <body>
    <script src="https://example.com/js/jquery-3.6.0.min.js?ver=6.8.2" async></script>
  </body>
</html>

Double-check your HTML source code to ensure there are no accidental typos or misplaced quote marks in your tag attributes.

Related W3C validator issues