npm / jquery
jquery
What changed in jquery 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
24 breaking1 security2 deprecations3 new APIs and options6 behavior and defaults15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjquery 451 changes
Breaking changes 24
Attribute values are no longer stringified in the setter.
Setting a non-ARIA attribute to false removes that attribute.
Support is dropped for IE below 11, iOS below 11, Firefox below 65, Android Browser, and PhantomJS.
The response content-type header, when present, overwrites s.contentType.
Whitespace surrounding CSS Custom Properties values is trimmed; whitespace-only values return undefined.
jQuery no longer automatically adds px to properties, with a few exceptions.
Deprecated jQuery APIs are removed.
Support for Edge Legacy, meaning non-Chromium Microsoft Edge, is dropped.
The project migrates from AMD to ES modules.
The event.which shim was removed.
jQuery stops shimming focusin and focusout events.
getStackHook is renamed to getErrorHook.
Removed jQuery.event.global.
Removed jQuery.fx.interval; developers can no longer configure the animation timer interval through this property.
jQuery.htmlPrefilter is now an identity function, so HTML passed through it is no longer rewritten.
jQuery.trim is deprecated and removed.
Automatic promotion of JSON requests to JSONP is removed.
Support for legacy selector pseudos was dropped.
offsetHeight(true) and related measurements include negative margins.
The opacity CSS hook is removed.
Scripts are not automatically executed unless dataType is provided, and scripts are not executed for unsuccessful HTTP responses.
Callbacks and deferred modules are excluded from the slim build.
The toggleClass(boolean|undefined) signature is removed.
Implemented uniqueSort as a chainable method.
Security 1
Manipulation gains basic TrustedHTML support.
Deprecations 2
AJAX event aliases are deprecated.
jQuery.expr.filters and jQuery.expr[":" ] are properly deprecated.
New APIs and options 3
.even() and .odd() are implemented as replacements for the POS :even and :odd selectors.
globalEval gains a doc parameter, and iframe scripts execute in their own context.
The script transport supports headers for cross-domain requests.
Behavior and default changes 6
The beforeunload event now uses .preventDefault().
Ajax supports binary data, including FormData.
Re-exposed jQuery.find.tokenize, jQuery.find.select, jQuery.find.compile, and jQuery.find.setDocument.
JSONP error script responses are executed.
Ajax requests can use processData: true even for binary data.
The show, hide, and toggle methods are included in the jQuery slim build.
Fixes and other changes 15
Falsy values in addClass(array) are skipped.
Fixed contents() on <object> elements with children, including in IE.
Calling $el.html(selfRemovingScript) is supported.
Cleanup no longer skips elements.
jQuery.Deferred.exceptionHook respects source maps.
A null value is accepted as a success function.
jQuery.isXMLDoc accepts falsy input.
A regression affecting jQuery.text() on HTMLDocument objects is fixed.
Selectors with leading combinators use qSA again.
Data and event manipulation prevent collisions with Object.prototype.
responseJSON works for erroneous same-domain JSONP requests.
DOM manipulation now respects the crossorigin attribute on scripts.
Selector lists work with qSA again.
Dimensions of table col elements are fixed.
Triggering focus, blur, or click now works with native handlers.