Avoiding Conflicts with Other Libraries | jQuery Learning Center

PHOTO EMBED

Sat Jan 29 2022 00:13:53 GMT+0000 (Coordinated Universal Time)

Saved by @lizziesnyc #jquery

<!-- Another way to put jQuery into no-conflict mode. -->
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
 
jQuery.noConflict();
 
jQuery( document ).ready(function( $ ) {
    // You can use the locally-scoped $ in here as an alias to jQuery.
    $( "div" ).hide();
});
 
// The $ variable in the global scope has the prototype.js meaning.
window.onload = function(){
    var mainDiv = $( "main" );
}
 
</script>
content_copyCOPY

https://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/