As you already know, jQuery uses the dollar sign (
$) as a shortcut or alias for
$ as a function or variable name, just as jQuery does.
If two different libraries are using the same shortcut, one of them might stop working.
Fortunately, jQuery provides a special
$.noConflict() method to deal with such situation.
$.noConflict() method releases jQuery's control of the
$ variable, so that other scripts can use it.
You can of course still use jQuery, simply by writing the full name instead of the shortcut:
jQuery("p").text("jQuery working perfectly!!!");
This method can also be used to specify a new custom name for the jQuery variable.
The following example creates a different alias instead of jQuery to use in the rest of the script:
let jq = $.noConflict();
For a complete Misc methods reference, visit our jQuery Misc Reference.