JSFiddle - React, Tailwind, and code Playground

by Michael Prosser

JavaScript

confirm(heading,message,callback){
		
		let ui = $('<div class="confirm-delete"><div><h1>' + heading + '</h1><p>' + message + '</p><p><button class="cancel">CANCEL</button><button class="ok">OK</button></p></div></div>');
		
		ui.find('button.cancel').click(function(){
			
			ui.remove();
			
		});
		
		ui.find('button.ok').click(function(){
			
			if(typeof(callback) == 'function'){
				
				callback();
				
			}
			
			ui.remove();
			
		});
		
		$('body').append(ui);
		
	}


  confirm("MY HEADING","MY MESSAAGE",function(){

    // remove the cells here

  });