<!DOCTYPE html>
<html>
    <body>
        <h1>Mootools test page</h1>
        <p><a href="#" id="alert-button">click me for alert</a></p>
        <p><a href="#" id="confirm-button">click me for confirm</a></p>
        <p><a href="#" id="prompt-button">click me for prompt</a></p>
        <script src="/static/mootools.js" type="text/javascript"></script>
        <script type="text/javascript">
            var promptValue = null;
            window.addEvent('domready', function(){
                var alertButton = document.id('alert-button');
                alertButton.addEvent('click', function(e) {
                    alert('this is an alert');
                    e.stop();
                });
                var confirmButton = document.id('confirm-button');
                confirmButton.addEvent('click', function(e) {
                    if (confirm('this is a confirm')) {
                        alert('you confirmed!');
                    } else {
                        alert('you denied!');
                    }
                    e.stop();
                });
                var promptButton = document.id('prompt-button');
                promptButton.addEvent('click', function(e) {
                    promptValue = prompt("Prompt ?")
                    e.stop();
                });
            });
        </script>
    </body>
</html>
