Change record status: 
Project: 
Introduced in branch: 
8.9.x
Introduced in version: 
8.9.0-beta3
Description: 

Drupal 8.9 and above have been updated to jQuery 3.5.1.

jQuery versions before 3.5 incorrectly used XHTML parsing logic when parsing HTML strings in documents with the text/html content type, which all Drupal pages are by default. jQuery 3.5 fixes this, but it's a breaking change for JavaScript code that relied on the prior, incorrect, behavior.

If you had code that did something like this:

$("<div/><div/>")

and if your intention with that was to create two sibling DIV elements, you will need to change that to:

$("<div></div><div></div>")

Code that creates a single element with self-closing syntax (e.g., $("<div/>")) is unaffected by this change. Although that is technically incorrect HTML (HTML does not allow self-closing tags on non-void elements), browsers simply treat that as an unclosed open tag and create the intended single element anyway.

Code that uses self-closing syntax for elements where that's allowed by HTML (void elements, SVG, and MathML) are also unaffected by this change.

This change affects all jQuery functions that parse HTML: $(), $.parseHTML(), $().html(), $().append(), etc.

If you find contrib modules or 3rd party libraries that are broken by this change, please report that in this issue.

Impacts: 
Site builders, administrators, editors
Module developers
Themers
Site templates, recipes and distribution developers