JSFiddle - React, Tailwind, and code Playground

by f0t0n

HTML

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
    </head>
    <body>
        <a href="http://google.com" id="btn">Button</a>
        <div id="dlg">Continue?</div>
    </body>
</html>

JavaScript

var dlg$ = $('#dlg').dialog({
    title: 'Confirm action',
    autoOpen: false,
    buttons: {
        'Agree': function() {
            dlg$.dialog('close');
            //window.location = dlg$.data('url');
            alert(dlg$.data('url'));

        }
    }
}),
btn$ = $('#btn').on('click', function(e, data) {
    e.preventDefault();
    dlg$.data('url', this.href).dialog('open');
});