Creating dialog boxes for user information and input

In Chapter 6, User Interface, you were shown how to create your own modal pop ups. jQuery UI provides an easy-to-use API that helps you to quickly add modals or dialogs to your application. This recipe will look at the default behavior of jQuery UI's dialogs and show you how to use them. Once again, this recipe is designed so that you can easily find the code you need and re-use it at your convenience.

Getting ready

In the chapter9 folder, create recipe-2.html and recipe-2.js and have them open and ready for editing.

How to do it…

To understand how to quickly add dialogs or modals to your application, perform the following steps:

  1. Add the following HTML to recipe-2.html in order to create the button ...

Get jQuery 2.0 Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.