ifTree - Javascript Confirm

{
    nodes: {
        start: {
            text: "<p>You are a bare concrete bunker standing in front of a shiny red button.</p>",
            options: [{
                label: "Press the button!",
                target: "boom",
                }]
        },
        boom:  { 
            text:"<p>BOOOOOOM!!!</p> <p>Everything explodes, probably shouldn't have pressed that button.</p>",
            onShow: function() { 
                    if (!window.confirm("Are you sure?")) { 
                            return "phew";
                    } 
                } 
        },
        phew: {
            text: "<p>Yeah, probably best not to play with it.</p>"
        }
    }
}
    

« More examples