Objective and outcomes

In this tutorial we are going learn about switching between multiple modals using jquery modal() function.Also we need to include jquery.js file in our document for modal() function to work. Click on the button below to open the modal.You can learn about modals in our bootstrap tutorials.





Javascript

<script>
function show_modal1()
{
$("#modal2").modal("hide");
$("#modal1").modal("show");
}
function show_modal2()
{
$("#modal1").modal("hide");
$("#modal2").modal("show");
}
</script>


Our work is done by simply using modal() function with 'hide' and 'show' parameters.