Creating stylish and functional buttons

It is relatively easy to create stylish buttons quickly with CSS3, but adding additional functionality often requires more investment in terms of time. jQuery UI provides a button API that can be used to create a wide range of button controls, which can be easily added to UIs and interacted with inside JavaScript code. This recipe shows you how to create common button controls so that you can re-use the code at your convenience.

Getting ready

Inside the chapter9 folder that was created earlier, create recipe-1.html and recipe-1.js.

How to do it…

To create a range of different button controls using the jQuery UI library, perform the following steps:

  1. Add the following HTML code to recipe-1.html in order to add ...

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.