<button onClick="handleClick()">Click Me</button>
function handleClick() {
    var confirmed = confirm("confirm this");  
  
    if (confirmed) {
        // Do something
    }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.