Try It Editor
Tip: Press
Ctrl/⌘ + Enter
to Run
▶ Run
Reset
Copy
Download
Code
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>noConflict()</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> <div id="out"></div> <script> var jq = jQuery.noConflict(true); // in real multi-lib pages you'd include 2 libs (function($){ $("#out").text("Using alias without $ collisions."); })(jq); </script> </body> </html>
Output