JSFiddle - React, Tailwind, and code Playground

by Plippie Plop

HTML

<p id="vjs-menu-item"> click me </p>
<button type="button" id="btn01">
CLICK
</button>
<button type="button" id="btn02">
CLICK prevent
</button>
<button type="button" id="btn03">
CLICK preventImdiate
</button>
<button type="button" id="btn04">
CLICK preventImdiate via doc
</button>

<div id="output">

</div>

JavaScript

$(document).ready(function(){

let output = $('#output');


  $("#btn01").on('click',function(){
  	console.log('buton');
  });
   $("#btn02").on('click', function(e){
   e.preventDefault();
  	console.log('PreventDefault button');
  });
     $("#btn03").on('click',function(e){
   e.stopImmediatePropagation();
  	console.log('PreventImmediate button');
  });
       $(document).on('click', '#btn04',function(e){
   e.stopImmediatePropagation();
  	console.log('PreventImmediate button via doc');
  });
  
  
  $(document).on('click', function(){
  console.log("doc");
  
  });
  
});