「jQuery」noConflict()のサンプル

2021年7月19日

書式
jQuery(セレクター).click(function(){
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<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>

 

jQuery

Posted by arkgame