「jQuery」noConflict()のサンプル
書式
jQuery(セレクター).click(function(){
使用例
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$.noConflict();
jQuery(document).ready(function(){
jQuery("button").click(function(){
jQuery(".cft").text("222");
});
});
</script>
</head>
<body>
<div class="cft">11111</div>
<button>テスト</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$.noConflict();
jQuery(document).ready(function(){
jQuery("button").click(function(){
jQuery(".cft").text("222");
});
});
</script>
</head>
<body>
<div class="cft">11111</div>
<button>テスト</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $.noConflict(); jQuery(document).ready(function(){ jQuery("button").click(function(){ jQuery(".cft").text("222"); }); }); </script> </head> <body> <div class="cft">11111</div> <button>テスト</button>