I can't get an event listener in Chrome DevTools and Firefox DevTools when creating a different alias instead of jQuery to use jQuery.noConflict
I would like to know how to get event listeners in Chrome DevTools or Firefox DevTools when using jQuery noConflict.
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<!--
external js file that I cannot change.
<script src="external.js"></script>
-->
<script>
//Contents of external.js
let $j = $.noConflict(true);
(function($) {
$(function() {
init();
});
function init() {
$('.click').on('click', function() {
console.log('click');
return false;
});
}
})($j);
$j = null;
</script>
<a href="#" class="click">click</a>