Button click not working and close form using a button

Button click not working and close form using a button

I have the below script:

<script type="text/javascript">
    $(window).load(function () {
        $('#popupsubmit').modal('show');
    });
</script>
<div class="modal hide" id="popupsubmit" style="text-align: center;">
    <div class="modal-header">
        <a class="close" data-dismiss="modal">×</a>
        <h1>
            Thanks</h1>
    </div>
    <div class="modal-body">
        <p>
            This is my message
        <br />
        <a data-dismiss="modal" class="button">Next</a>
        <br />
    </div>
</div>

I am attempting to display a modal form when a user clicks a button (this opens a new form). So far my attempts have not worked by modifying the (window).load function to change it to a button so

1. How could i load up another form using a button click event?
2. At present when i run this code on the page load event it displays the form, but i can click anywhere outside of the window which closes it - how could i change this behaviour so it closes by clicking a 'close' button?