Compare Β· Core Β· jQuery-compatible

jsKjs vs jQuery

jsKjs implements the jQuery API most code actually uses β€” on native browser features β€” and adds three more modules. Here is exactly where it matches, differs and stops.

Choose jsKjs when…
  • You target evergreen browsers and want the jQuery API without the legacy weight.
  • You also need declarative requests, reactive state or real animation β€” without three more libraries.
  • You want native Promises, fetch and WeakMap-based data by default.
Choose jQuery when…
  • You must support Internet Explorer 11 or other pre-2021 browsers.
  • You depend on jQuery plugins that use internals ($.fx, $.Deferred, ajax prefilters/transports).
  • You rely heavily on the fx queue (.stop(), .delay(), .queue()).

Feature by feature

Compared with jQuery 4.0.0. βœ“ works the same Β· ◐ supported with differences Β· βœ— not included.

jQuery features and jsKjs support
jQueryjsKjsNotes
$() selectors, context, HTML creation, DOM readyβœ“ YesNative querySelectorAll; jQuery-only pseudos (:visible, :first) are not CSS.
Collection basics: .each .get .eq .first .last .index .addβœ“ YesCollections are real Arrays; native .map/.slice return plain arrays.
.html .text .valβœ“ Yes.val() on a checkbox returns a boolean.
.attr .removeAttr .prop .data .removeDataβœ“ Yes.data() parses data-* JSON; storage is a WeakMap.
.addClass .removeClass .toggleClass .hasClass .cssβœ“ Yes.css() also reads and writes custom properties.
.width .height .offset .position .scrollTop .scrollLeft◐ PartialNo .innerWidth/.outerWidth or .offset() setter.
.show .hide .toggleβœ“ Yes
.append .prepend .before .after .appendTo .prependTo .wrap .remove .detach .empty .clone .replaceWithβœ“ Yes
.wrapAll .wrapInner .unwrapβœ— No
.find .filter .not .is .closest .parent .parents .children .siblings .next .prevβœ“ Yes.filter/.not/.is accept selectors, elements or functions.
.nextAll .prevAll .nextUntil .prevUntil .parentsUntil .has .contents .end .addBack .sliceβœ— No
.on .off .one .trigger, delegation, namespaces, shortcuts, .hoverβœ“ YesHandlers receive the native Event; .trigger takes one payload object.
.bind .unbind .live .delegate .dieβœ— NoRemoved from modern jQuery too β€” use .on().
$.ajax $.get $.post $.getJSON .load .serialize◐ PartialPromise-based (fetch), not jqXHR; callbacks and .done/.fail/.always still work.
$.ajaxSetup, prefilters, transports, JSONP, $.getScript, .serializeArrayβœ— No
.fadeIn .fadeOut .fadeToggle .slideDown .slideUp .slideToggle .animateβœ“ YesSame names, milliseconds and callbacks; runs on the Motion engine.
.stop .finish .delay .queue .dequeue .fadeTo, $.fxβœ— NoUse await, timelines or setTimeout.
$.Deferred $.Callbacks $.whenβœ— NoUse native Promises.
$.each $.map $.extend $.param $.parseHTML $.trim $.isArray $.isFunction $.isPlainObject $.noConflictβœ“ YesDeep $.extend is prototype-pollution safe.
$.grep $.inArray $.merge $.makeArray $.type $.nowβœ— NoUse Array methods and Date.now().
$.fn plugins◐ Partial$.fn is the collection prototype, so plugins built on supported APIs work.
Browser support◐ PartialjsKjs: evergreen only. jQuery 4: also IE11 and older Safari/Firefox.

Writing a tiny plugin still works

JavaScript
$.fn.highlight = function (color = 'yellow') {
  return this.css('background', color);   // return this to stay chainable
};
$('.match').highlight();

See every Core feature live β†’